Space-Shooter project, eight days to go
1,527
0
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:
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
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
Previous
Space-Shooter project, seven days to go
Next
Space-Shooter game project, four day extension!
Advertisement
Advertisement
Advertisement
Discussion