View Full Version: NetMission Engine

Mp2d > Announcements, Rules and Regulations > NetMission Engine

Pages: [1] 2

Title: NetMission Engine


Troid92 - September 1, 2009 04:16 AM (GMT)
Greetings.

Almost three months ago we discussed possible ways to get MP2D 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 MP2D, 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:
user posted image

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 Metroid Prime 2-D. However, as long as there is one person working on the project, the project lives on. Frankly, MP2D 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 MP2D does not have any better ideas when NetMission becomes usable, I will round people up and start building MP2D with it, whether it be here or on the other side of the Internet.

Metroid_Zapper - September 1, 2009 04:37 AM (GMT)
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.

Infinity's End - September 1, 2009 04:48 AM (GMT)
I'm all for it. I still want to see this project done.

MickeyG - September 1, 2009 11:15 AM (GMT)
hey Troid, yet again i really like your work! good job on this :D keep it up

Under The Ashes - September 1, 2009 01:28 PM (GMT)
I'm sure its great. And I say that because I don't have a windows. :( So I cant see it. Or play it.

Troid92 - September 1, 2009 02:05 PM (GMT)
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. :P

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 MP2D 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.

DeProgrammer - September 1, 2009 02:16 PM (GMT)
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;
}
(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. :P 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.

Metroid Commander - September 1, 2009 04:21 PM (GMT)
Hey troid could u plz make a vid of ur demo, i have a mac so i can't play it ??
MC

Zurginator - September 1, 2009 08:04 PM (GMT)
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). :D

Liksmaskaren - September 1, 2009 08:10 PM (GMT)
Troid. You rock.

Under The Ashes - September 1, 2009 08:17 PM (GMT)
QUOTE (Liksmaskaren @ Sep 1 2009, 03:10 PM)
Troid. You rock.

Has he ever not?

Candy Man Criminal - September 1, 2009 08:23 PM (GMT)
i fucking love you troid =D

Phlake Jr. - September 1, 2009 10:05 PM (GMT)
I say use Rundas' Samus.

Troid92 - September 2, 2009 01:04 AM (GMT)
QUOTE (DeProgrammer @ Sep 1 2009, 08:16 AM)
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?

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. :P

Zurginator - September 2, 2009 01:29 AM (GMT)
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.

DeProgrammer - September 2, 2009 01:31 AM (GMT)
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. :P

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();
  }
 }
}


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

Zurginator - September 2, 2009 01:37 AM (GMT)
Oh yeah, Music works too. :D

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

Syntax Man - September 2, 2009 01:58 AM (GMT)
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.

Nova - September 2, 2009 11:34 PM (GMT)
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. :D

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.

Zurginator - September 2, 2009 11:40 PM (GMT)
QUOTE (Nova @ Sep 2 2009, 11:34 PM)
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. :D

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. :mad:

timmehboy - September 5, 2009 01:08 PM (GMT)
I'd like to help, I'm free weekends and hols.
The engine isn't bad at all with the help of the DLLs, it might need some tweaking for the physics (made reall have an epileptic fit), but what you have now will be fine for dying Space Pirates. Does this mean the Artifacts of the Month will start over again? If so... count me in ;)

Troid92 - September 5, 2009 08:57 PM (GMT)
QUOTE (timmehboy @ Sep 5 2009, 07:08 AM)
I'd like to help, I'm free weekends and hols.
The engine isn't bad at all with the help of the DLLs, it might need some tweaking for the physics (made reall have an epileptic fit), but what you have now will be fine for dying Space Pirates. Does this mean the Artifacts of the Month will start over again? If so... count me in ;)

Thanks for the support. :D

Artifacts of the Month was hard for me to keep running consistently, but I would be glad to start it up again if people want it back.

Yes, one of the glitches is getting MR to shake violently for no reason, sometimes enough to jump to the top of the screen. Animated models won't have this issue, and I'll look into it for future ragdolls like dead pirates.

Speaking of DLLs, I know I can cut my DLL usage at least in half, but I had trouble doing so in my compiler/IDE setup.


==========


Attention!

For those who could not run the demo posted, here is a video of me playing it:
http://www.filefront.com/14472583/nmdemo.mp4

Sorry if the music is a little jumpy at the start. Recording it was a little CPU-intensive, and the software-rendered audio responds poorly to that.

Candy Man Criminal - September 6, 2009 12:31 AM (GMT)
troid brings rape

Zurginator - September 6, 2009 01:03 AM (GMT)
Next version should include samus with a gravity gun, to explain why ridley does this. xD

Candy Man Criminal - September 6, 2009 01:49 AM (GMT)
... or the drilldo

Ryan-Phoenixan - September 27, 2009 01:04 AM (GMT)
Excellent work there. I'm rather impressed. :)

Troid92 - January 1, 2010 02:17 AM (GMT)
Thanks.

Future updates will be posted in the other NetMission topic.

(Latest update)

Under The Ashes - January 3, 2010 02:12 AM (GMT)
How close are you to completing your engine? It seems well on it's way, but I can't exactly tell. Do you have a percentage?

MetalCoreSuit - April 18, 2010 02:13 AM (GMT)
can i help you with something like some sprites,story, music or something?

Phlakes - April 18, 2010 12:45 PM (GMT)
Do not bump 3 month old topics.

Zurginator - April 18, 2010 12:46 PM (GMT)
Phlakes, it's pinned. You might wanna watch it or I'll get you in trouble for harassing new members.

Candy Man Criminal - April 18, 2010 04:02 PM (GMT)
this topic isnt pinned, check again

Zurginator - April 18, 2010 04:49 PM (GMT)
Why don't you? ;)

Candy Man Criminal - April 18, 2010 05:17 PM (GMT)
you just pinned it =P

Under The Ashes - April 20, 2010 03:59 AM (GMT)
lol'd.

s123i68 - April 20, 2010 04:35 AM (GMT)
QUOTE (Under The Ashes @ Apr 19 2010, 08:59 PM)
lol'd.

I kinda smirked. :P

Under The Ashes - April 20, 2010 01:04 PM (GMT)
I just thought it was a clever move.

Troid92 - May 10, 2010 01:06 AM (GMT)
QUOTE (MetalCoreSuit @ Apr 17 2010, 08:13 PM)
can i help you with something like some sprites,story, music or something?

Sprites -- From what I've seen you're a good spriter. Click here for the full sprite list.
Story -- We're following Metroid Prime's story exactly, so it's all done for us.
Music -- I'm pretty sure the soundtrack is almost completely done. It needs touch-ups, but right now I don't think music is our biggest priority.

Welcome. And ignore everyone else. :P

Under The Ashes - May 10, 2010 01:33 PM (GMT)
Look at Troid, being all nice. :)

HunterX2 - January 13, 2012 12:25 AM (GMT)
I Clicked the Lnk It Says File Not Found Can U Give Me A Download Link




* Hosted for free by InvisionFree