So I'm making a Pirate RPG game called Vortex Voyager (github.com/chase4926/VortexVoyager) and one of our project goals is to be very moddable. So for our main menu, we're using an xml file to "style" it, and in doing so, are making xpath calls every frame.
Is this reasonable?
When myself and the other person on the team run it, we get a smooth 60, but is this going to be a serious problem when we get into things other than the main menu?
Also I should note:
I have a specific need for Nokogiri due to it's searching ability, which prevents me from using something a little more efficient like xml-simple (which simply converts an XML file into a hash).
I'm not quite sure I understand how you're using nokogiri every frame, but I would recommend using yaml (xml is so heavy and nasty to work with). You should be able to load/parse your configs (xml or yaml) only once, store what you need and build your menus from that. After that you wouldn't need to parse any xml/yaml again. An example of using yaml to style GUIs can be found at my discontinued Rubygoo project here: https://github.com/shawn42/rubygoo/blob/master/themes/default/config.yml
hope that helps,
Well, you can always benchmark it and see how much time you're consuming. As long as even old machines can stay under 16ms for a frame, you're fine :)
But I have to second the suggestion to use something like YAML which maps very naturally to Ruby, where you can then use standard
Enumerable methods to perform your lookup logic.
Just spend about an hour converting it all to YAML.
Enumerable::select is what I needed, didn't use it before today.
Hey I just cloned VortexVoyager and tried running it. I executed "ruby main.rb" from the /src folder, and I got the following error:
initialize': uninitialized constant ControllerObject::Queue (NameError)initialize'
Any suggestions?... I'm just interested in getting a peek at the project.
My friend also had this issue, no idea what's causing it but there's an easy solution:
Also on the title screen, the konami code followed by enter may or may not activate an easter egg.
Hey thanks, I'll give it another whirl.
Wow, "require 'thread'" took care of everything! I love it when things work! Looks like the project is coming along nicely, with a solid, robust core. I won't provide any unsolicited feedback as this is clearly at the early development stage - except to say thanks for sharing - I will be able to learn a lot from studying this code, especially as the game moves further along. I scrolled around and looked at the world a bit.
I'm still trying to figure out what "the konami code" is.... I guess I'll have to dig around in the source for it...
If you are interested in having another contributor, sign me up! I'm pretty (very) novice at programming, but I can certainly take orders and help with creating graphics and animations and those kinds of things.
Thanks again for sharing!
Just tried it out - the Easter Egg is AWESOME!
And here I always thought that was the "Contra Code"...
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill