This week I got a chance to sit down and get my first attempt at a particle system working. The thing that slowed me down was only having an Update all actors loop. Since I was spawning particles on things like death of an asteroid I was invalidating my iterators. Rather than switching the container I was using etc. I decided getting a event or messaging system going would be better.
Now my main update looks like this:
- Update tuning variables from Lua
- Process message queue (this is new)
- Handle input
- Update all actors
- Special collision death loop (this will be rewritten to use messages)
- Game end condition check (this will be rewritten to use messages)
I am starting to think that if I had actually created a messaging system up front then I would have had an easier time over the last few weeks. Doing this system has made me re-assess if doing it right from the beginning is actually better or not. Next steps are to get some fun particles going in game so I get some visual progress and perhaps some sound FX as well! Then I might look at getting my custom message classes into Lua since I think that might actually save me a serious amount of time. I’m hoping that in the next three weeks I will have a rough working version of my ship vs. inanimate object combat working and looking good.
The bad news is that my laptop is really starting to slow me down. I sort of noticed that it only lets me have two simultaneous keys down awhile ago but it didn’t really affect anything. Now that I want to accelerate, turn and shoot it is getting very annoying. I currently fear that this is a hardware issue. Anyone know how to find out about key press limits? I cannot even find anyone else complaining about it so I think something might be wrong with my laptop. I ran into huge issues when I was trying to indulge in some retro Myth 2 gaming. Keys would get stuck for several seconds rather than updating smoothly. Looks like I should pinch pennies and buy a new laptop. Front runners are the Dell XPS line and a MacBook. Any recommendations?
I would be interested in a little more detail about how you do some things (though maybe you mentioned some things in a previous post I haven’t read). I was wondering:
1) What are you using for graphics and such, OpenGL? DirectX?
2) How are you interfacing with Lua, one of the existing libraries or directly with the C interface?
4) What kind of IDE do you use? Eclipse, Visual Studio, Notepad?
3) How do these “messages” work?
4) Are you gonna make a video soon to show off? (particles! 🙂 )
I’m also working on end-game/level logic, I haven’t tried but i think i might be able to just use my existing Actor class… (each actor can define an update() function in lua).
You’ve sort of inspired me to want to publish my progress too. If i have time I will.
My keyboard also has an issue handling more then two keys too. Weird thing is, it only seems to care if one of them is an arrow key, so i use WSAD keys for movement (which makes sense because i think im going to be using the mouse for aiming).
Also i think you meant re-assess 🙂
1.) PopCap Framework. This is built on DirectX (version 6 I think…old school).
2.) My lua interaction is “lame” right now. I have tolua++ ready to go but I am really only calling one function to get some global variables. I am planning on extending/exposing all my game play classes with Lua.
3.) I use visual studio and vim.
4.) My “messages/events” are basically a list of actions that a queue up to action in the next frame. They are currently classes. Eventually I would like this to be everything I need to replay a game. I might elaborate more on this in a future post if I actually like how I did it.
5.) Video -> Yeah, once I have particles looking decent I will do a video.
Posting progress really keeps me working. I recommend it! Let me know if you do set something up. WordPress is free. Even if I’m not proud of what I did, I will update once a week. You also asked in a previous post if I was going to post demos. I am currently hosted by wordpress so I cannot post right now. Sometime in the next few months I will move to my own host. I will look for a way to post demos in the meantime, however my priority is progress!
Interesting…I might try moving to WASD. I’ll let you know how that works.