Space-Shooter project, eight days to go

Published February 19, 2011
Advertisement
After ending my coding late yesterday, I overslept this morning and didn't get up until eleven. That really hurt, because I had to work at the grocery store from one pm, and then it's a saturday evening, so I want to spend that socially with my wife. As such, I only got in an hour or so of work today!

I figured there was no point on starting a quad-tree implementation, so I went through the code and did some smaller optimizations. One trick I stumbled upon by accident recently was doing erasing from std vectors like this:

//O(1) removal

list = list.back();
list.pop_back();



I also have some Lua components now that subscribe to OnUpdate(), thus each of those components, for each instance of them, will require a transition between C++ and Lua. I suspect there's more overhead to this than my game really should like... so it might soon be time to move some of those components over to C++ code. Also, currently, components don't "subscribe" to events. If a scripted component has an OnEvent function declared, it will receive all events sent to it's entity via C++... Most components only care about a single specific event, maybe two... so needless to say, there's a lot of overhead here as well! I should really exchange this for a subscription-based event handling, so that the component's OnEvent function is only called when an event occurs that the component is going to use.

Tomorrow should be more productive :)
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement