NetMission Engine

Greetings.

Almost three months ago we discussed possible ways to get P2D actually up and running, with Daz?s Super Metroid Prime idea being at the forefront. The pros and cons were juggled around, but the discussion quickly fizzled into nothing. Some of you may recall that in the discussion I mentioned that by summer?s end I might be able to ?pull something together? related to the unformed and fragmented game engine that I claim to be working on. Today I am unveiling what I managed to make. Hopefully this will at least make you comfortable knowing that there is still another option out there.

My goal this summer was to use my game engine, called NetMission, to recreate a cut scene from Metroid Prime. The cut scene is at 01:51 in the following video:
http://vids.myspace.com/index.cfm?fuseacti…ideoid=49487898

I chose this specific cut scene for a number of reasons. At the time I had some experience with several features that I wanted to fully expand upon in my engine, including reflective surfaces (like water), 2-D lighting and shadow casting, sound effects (like reverb), and particles. Each of those features could be used effectively in the cut scene, and all the necessary resources were done or in a usable state.

Meta Ridley would give me the opportunity to design a 2-D model and animation system (aka. part-based objects) to show off the possibilities. I think that having a robust part-based system is necessary for P2D, considering the many complicated bosses and enemies. These two videos are great examples of how part-based creatures can become very fluid and life-like when animated well, even with only few sprites or images:
http://www.youtube.com/watch?v=Frl1woD-j2U&fmt=18
http://www.youtube.com/watch?v=n2–XAolWF8&fmt=18

At the start of the summer NetMission was in pieces and mostly unformed, and it was at such an early stage that a good game could certainly not be made with it. It should be evident now that my goal was not just to create a cut scene, but to greatly improve my lacking game engine with many new and exciting features that could be used to create a cut scene and much more.

I did not come close to reaching my goal, but I am happy and satisfied with the progress I have made. Here is a quick demo:
http://www.filefront.com/14441363/demo.zip

Note: I did not make everything in the demo. Please read the readme file for important credit information!

Screenshot:

Edit: Note that this demo is for Windows only. If you are unable to run it, here is a video of it in action:
http://www.filefront.com/14472583/nmdemo.mp4

I know, there are glitches in the demo, and some of them are funny to watch. I would have fixed them if I’d had more time. That’s what you get with a freely-draggable rag-doll, real-time physics, and a poorly-thrown-together model. Those glitches will be gone when these models can be animated.

I am aware that at the moment there are about eight active members here, and I am the only one who is still working on Prime 2-D. However, as long as there is one person working on the project, the project lives on. Frankly, P2D is a twice-undead zombie with a hangover and it?s funny to watch it try to crawl around, but it?s not dead because I?m here to say it?s not.

I will continue to work on NetMission because I intend to use it for a fan-game I am leading called Metroid: Net Mission, hence the name of the engine. If P2D does not have any better ideas when NetMission becomes usable, I will round people up and start building P2D with it, whether it be here or on the other side of the Internet.

Troid’s worked hard on this one guys, let’s not leave him with his work done for nothing. I’m with you man. Sure I’m never on the Forums, but I’m always in contact with Troid.

I’m all for it. I still want to see this project done.

hey Troid, yet again i really like your work! good job on this :smiley: keep it up

I’m sure its great. And I say that because I don’t have a windows. :frowning: So I cant see it. Or play it.

I just noticed and fixed an important typo. Those of you who have already read my post, please change “I did come close” to “I did not come close” in your heads. That should make more sense. :stuck_out_tongue:

I’m using libraries like OpenAL Soft and OpenGL that work on platforms other than Windows, so one day I’ll try to bring NetMission to the worlds of Linux and Macintosh.

Remember that I’m starting school now. I may have been exaggerating when I said I would be hit by a tidal wave and thrown inside a black hole for nine months, but this is looking to be another tough year. There will be entire months at a time so busy that I won’t be getting enough sleep and won’t have any time to stop by here, let alone program away at a game engine. I may not have made it clear in my post above, but it will take me years to make NetMission usable. I’m sorry if this puts P2D in another dull waiting situation, but you have my word that NetMission will be finished one day.

Oh, by the way, I made a new sprite over the summer and it looks awesome. I’ll try to post it sometime.

Leaving for school now.

Won’t work for me. I opened it three times but only got it to show something once, and when it did show something, Ridley wouldn’t move. How did you do the timing, and did you include a sort of DoEvents?

[code]// Dispatch all waiting events
void tpkWDoEvents() {
? ?MSG M;

? ?// Go until there’s nothing left
? ?while (PeekMessage(&M, NULL, 0, 0, PM_REMOVE)) {
? ? ? ?TranslateMessage(&M);
? ? ? ?DispatchMessage(&M);
? ?}

? ?return;
}[/code] (This one’s from Guy Perfect.)

But hey, you have my full support. Except I have no idea how all the libraries you’re using work. :stuck_out_tongue: If you need it, I have stuff for key input the way Nintendo consoles do it, timing using the high-resolution counter (because it’s not screwy like GetTickCount in Windows–however, some computers apparently don’t have a high-resolution counter, so it doesn’t work on those), etc.

We’re going to have to learn how to deal with the windowing systems on the different platforms to make things cross-platform. The DoEvents thing (which is part of the windowing system, actually) and timing code is going to be different, too.

Hey troid could u plz make a vid of ur demo, i have a mac so i can’t play it ??
MC

Troid, make sure it supports HD resolutions. I’m feeling the urge to make an HD side-scrolling Metroid (Think: The Super Metroid of this gen). :smiley:

Troid. You rock.

Has he ever not?

i fucking love you troid =D

I say use Rundas’ Samus.

Yes, I do that section of the message pump each frame.

But I was a little worried about the framerate code. Last week I tested the engine on a Vista laptop and it ran as fast as possible. Turns out the latest framerate code had stopped actually doing anything, and I didn’t notice because my setup waits with VSync and the Vista laptop doesn’t. So I temporarily replaced that code with an old version that I knew worked, but the old code had plenty of other issues. I didn’t have the time to mess with it, and it worked well enough on both systems, and I don’t exactly have many systems to test it on… so that old code is what’s in the demo.

I just opened it up to see how it works (since I’d forgotten). It uses timeGetTime() and assumes that 1000 units = 1 second. The inaccuracy of timeGetTime() makes it a little choppy, but it runs at the target FPS on average. It makes sure it never Sleep()s for more than a frame’s length of time. When it gets behind, it skips rendering until it catches up. Bingo. That’s the spiral of death. If the framerate code is really the cause of your problem (which it might not be), then it could be that your CPU is not able to keep up, causing it to frameskip its way into infinity rather than run a little slower. Does task manager show the CPU level at the process’s fullest? Does the music play?

Thanks a lot for the support (and the important bug report!). All of my OS-related code is a big old inefficient mess. It was the first part of the engine I wrote when I was learning C++ years ago, so I had no idea what I was doing at the time. I would’ve performed surgery on it this summer if I wasn’t so rushed to get out a demo. That’ll have to be the next thing I do. If I need help I know who to ask.

======

Funny, nobody has mentioned being able to run the demo yet. Did the other Windows users out there get it to run? If so, does Ridley have a reflection?

As for those who can’t get it to run, I’ll try to record a video soon, meaning this weekend at the latest. If someone would be kind enough to beat me to it, that would be great. :stuck_out_tongue:

Runs, smoothly, with the reflection. Excellent work on the ragdoll, but you need to make it so that things can fall through things they are in front of, it makes some odd things happen otherwise lol.

Music plays–I tested it earlier with my sound off because I was in the math help room–and I can hear a “pwip” sound when I click, but yeah, no graphics… So infinite frame-skipping sounds about right. I think I set my timing up to render a minimum of every other frame. Pity my puny 2 GHz processor and integrated graphics card. Boo laptops. :stuck_out_tongue:

Using the high-resolution counter is a little bit more difficult than timeGetTime()/GetTicks()…but not much. Here’s a sloppy copy and paste of my timing stuff and game loop!

[code] LARGE_INTEGER perFreq, perCnt;
LARGE_INTEGER LastMS, StoreMS;
double Change=0;
QueryPerformanceCounter(&perCnt);
StoreMS.QuadPart=perCnt.QuadPart;
printf(“Timing initialized.\n”);

while (!Ending) {

? ? ? ?tpkWDoEvents();
? ? ? ?SleepEx(1, TRUE);

?LastMS.QuadPart = StoreMS.QuadPart;
?QueryPerformanceFrequency(&perFreq);
?QueryPerformanceCounter(&perCnt);
?Change += (perCnt.QuadPart - LastMS.QuadPart) * 1000 / perFreq.QuadPart;
?StoreMS.QuadPart = perCnt.QuadPart;

?if (Change>=TPF) {
? //if (Change >= TPF * 2) Change = TPF; //I’m gonna pretend this doesn’t happen.
? //Change -= TPF;
? Change = 0;
? if (GLRunning) {
? ?//TODO: Decide when to draw a frame and when to only calculate one
? ?CalcFrame();
? ?DrawFrame();
? }
?}
}
[/code]

Heh, guess it’s not set up to do every other frame after all. It used to be!

Oh yeah, Music works too. :smiley:

Btw, it works on 64-bit OS’s just fine, too.

It runs smoothly and everything works on x64 vista,

and I really want to see this project finished, partly to make my friend STFU but mostly because I’ve always liked the idea of MP in 2D, also if you’re working with open GL, perhaps you can make a WAD or dol or something that will run on the Wii via homebrew.

I can’t run it right now, as I’m on the Mac. If it’s anything like the last demo though, it will be amazing. :smiley:

Thanks Troid for not giving up on us and the project yet. I’ll be here full support for whenever you need me, and I’m sure the rest of us will too.

I won’t, I’ve got my own project to worry about. :angry: