Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Space-Shooter project, eight days to go

Space-Shooter project, eight days to go

Trefall
Trefall
Journal of Trefall · · 1 min read
1,527 0
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

Discussion

Loading comments...