What are you working on? V4 (HTML ISN'T PROGRAMMING)
2,003 replies, posted
Well, I think I need help with something.. but first, here's the outline of what I'm currently working on.
My current project is a programming game, a "code battle game" to be specific (you write some code for a bot, I write another, and the one that beats the crap out of the other wins); but unlike others that I've experimented with, this one will use realistic physics (as far as the engine I'm using goes), and a fully destructible world; and unlike them, it doesn't let you specify a "sprite" for your bot's appearance and call it a day, you have to provide a design that defines every loose screw in your bot's body AND the AI (the script which defines the bot's behavior).
Bodies of bots are assembled out a hull and other parts, each part is essentially a shape, with the addition of "hardpoints"/mounts that can be attached to different modules, those may include different engines, scanners, thrusters, weapons, extendible arms, etc; Parts also define their own hit-points, in percentages of the total bot HP (or the parent part they belong to); if no percentage is defined, the game engine will calculate that automatically based on size, number of hardpoints/sub-joints/etc.
Each part can define joints, a point where it's attached to another part (a child part in that case), a joint can be a fixed or a free one, and may detach when either of the parts it belongs to has 0 HP.
The hull is simply the "master" part, joints defined in the hull are considered master joints, and going from the hull outwards, if a joint fails, everything attached to it after that point is lost, and the hull goes on; if the hull's HP reaches 0, all is done for.
The scripting language will be JavaScript (I chose to embed Google V8), and I think it's very suitable for this kind of game, every body part will be accessible as "this.part[id]", if a part is destroyed it would return `Undefined`, just an example.
Each part/module added adds to the mass of the bot, and thus slows it down by a certain degree, and then there's energy usage too.
Now to the part where my question comes, here's my draft of the XML structure for bot body definition:
[code]<body>
<shapes>
<shape id="wing_right">
<point id="p1" x="0" y="0" />
<point id="p2" x="10" y="5" />
<point id="p3" x="0" y="5" />
</shape>
<shape id="wing_left">
<point id="p1" x="0" y="0" />
<point id="p2" x="-10" y="5" />
<point id="p3" x="0" y="5" />
</shape>
<shape id="hull_shape">
<point id="pHead" x="0" y="-10" />
<point id="pLeft" x="-5" y="0" />
<point id="pTail" x="0" y="10" />
<point id="pRight" x="5" y="0" />
</shape>
</shapes>
<parts>
<part id="rightWing" shape="wing_right" hp="20">
<hardpoint point="p2" />
<hardpoint point="p3" type="propulsion" />
</part>
<part id="leftWing" shape="wing_left" hp="20">
<hardpoint point="p2" />
<hardpoint point="p3" type="propulsion" />
</part>
<hull id="hull" shape="hull_shape" hp="40">
<joint point="pRight" part="rightWing" remote="p1" angle="90" fixed="true" />
<joint point="pLeft" part="leftWing" remote="p1" angle="90" fixed="true" />
<hardpoint point="pHead" />
<hardpoint point="pTail" type="propulsion" />
</hull>
</parts>
</body>[/code]
This would give it (roughly) this shape:
[IMG]http://i36.tinypic.com/1537aiu.gif[/IMG]
Right now, the way I have it is so that all coordinates for the points belonging to a shape are local to that shape, so that parts may reuse shapes with no prior assumptions, I also plan to include a set of importable standard shapes, and I think this will help standardize them a bit.
But due to my limited experience with Box2D, I was wondering if you can see anything that would make this impossible/a pain to implement as a b2Body? also, any suggestions on the XML elements/structure?
My mind is surging with ideas at the moment, maybe I'll even add an editor and a single player mode that teaches programming step by step, giving the player increasingly difficult challenges, and letting them program their bot to face them, but that's way ahead of my current goals.
You should definitely make an editor for generating the bot design. It would make designing bots much easier.
[QUOTE=Diaklu;18023702]Thanks for the invite again. In return, check out the new Status strip. I've also started work on this again and you can see [url=http://shadiku.com/?page_id=6]progress here[/url].
<image>[/QUOTE]
That bottom bar thing is really confusing to read. Why don't you just do "15/15 Addons enabled. 0/3 Gamemodes enabled"?
[QUOTE=Loli;18023541]Looking Good!
You should add a special mode where it doesn't render the wheels and only renders the car with like a blue tinge underneath it. Hover Truck Racing![/QUOTE]
Or replace the models with pod racers. :v:
r4nk, could I get an invite to Wave?
I don't post much in here, because I'm kind of new to programming.
if so:
[email]bmanraccoon@gmail.com[/email]
[QUOTE=raccoon12;18029608]r4nk, could I get an invite to Wave?
I don't post much in here, because I'm kind of new to programming.[/QUOTE]
I think he's ran out now.
[QUOTE=Ibutsu;18029992]I think he's ran out now.[/QUOTE]
Aw, oh well.
also: off topic and dumb:
3,000 post
It's more of a nomination instead of an invite, not everyone who gets "invited" actually gets the invite.
[QUOTE=efeX;18030261]It's more of a nomination instead of an invite, not everyone who gets "invited" actually gets the invite.[/QUOTE]
They do, it just might take two weeks for one person when it takes two days for another.
I forgot I was in wave xD I can send invites if someone tells me how! Also, I was invited about 2 weeks ago, it takes about 1-2 weeks to arrive.
[QUOTE='-[ Fizzadar ]-;18031375']I forgot I was in wave xD I can send invites if someone tells me how! Also, I was invited about 2 weeks ago, it takes about 1-2 weeks to arrive.[/QUOTE]
[quote]
How do I invite people to try Google Wave?
We have a long list of people who have either signed up for an invitation to Google Wave, or who have been nominated by a friend to get a Google Wave account. Unfortunately, we aren't able to pass out invites as fast as the nomination list has grown, so we're not currently adding more people to our waiting list.
As soon as we're confident that the system can accept more users, we will add a wave to your account that allows you to nominate friends and colleagues for an account. Once you have the capability to invite people, the wave appear in your inbox.
If you've already received an invite wave (you have seen it before in your inbox), you can search for "invite others to google wave" to find it. If you're out of invites, please bear with us as we work to add more people to the system. Once you've been given the capability to nominate more people, your invite wave will again appear in your inbox as an unread message.
You can always add to your Contacts list people who already have Google Wave accounts. Learn more about adding contacts.[/quote]
Nominate me if you can please.
im in google wave but it gave me a shit email address so i dont use it
[QUOTE=databee;18032106]im in google wave but it gave me a shit email address so i dont use it[/QUOTE]
Really? I mean, really!?
Hey. How about we stop talking about Google Wave and start talking about what we're working on. :v:
Eh, "working"(learning) with PHP right now.
Quick question for the PHP'ers: Are classes heavily used with recent PHP scripts? Is it standard? Or frowned upon?
[QUOTE=efeX;18039377]Eh, "working"(learning) with PHP right now.
Quick question for the PHP'ers: Are classes heavily used with recent PHP scripts? Is it standard? Or frowned upon?[/QUOTE]
I use classes all the time.
[QUOTE=efeX;18039377]Eh, "working"(learning) with PHP right now.
Quick question for the PHP'ers: Are classes heavily used with recent PHP scripts? Is it standard? Or frowned upon?[/QUOTE]
They make managing stuff easier but if you don't want to use them don't :3
[QUOTE=efeX;18039377]Eh, "working"(learning) with PHP right now.
Quick question for the PHP'ers: Are classes heavily used with recent PHP scripts? Is it standard? Or frowned upon?[/QUOTE]
Classes are probably best. I personally hate using them, because I hate coding them. If you can code them, use them.
Also, as Anthony said, it makes managing multiple instances of the class object, easier.
E.G if you are making forum software. You should use classes, but it is not necessary.
Curious as to why I was rated dumb for agreeing and offering an opinion.
[QUOTE=Fizzadar.;17986785]haha, just play it when it's out, and I'll be happy :P
Yeah, I keep forgetting to change the title, hehe[/QUOTE]So...PvP Pokemon?
My god how has no one done this before. Once it's released, I'll worship you.
[QUOTE=MiniManz;18039859]So...PvP Pokemon?
My god how has no one done this before. Once it's released, I'll worship you.[/QUOTE]
This
[QUOTE=Robber;18028914]You should definitely make an editor for generating the bot design. It would make designing bots much easier.[/QUOTE]
I agree, and after some thinking, perhaps I could initially write an external editor in C# or something, since it'll need a lot of GUI work.
Later on, a good step would be to rewrite it as an in-game editor, allowing the user to design and script the bot, interactive debugging support is also a possibility.
But that move won't happen until the project becomes relatively stable; I'll have to write lots of GUI code that runs on top of SFML/OpenGL, [url=http://code.google.com/p/sfui/]this[/url] looks promising though.
[QUOTE=Blynx6;18039770]Classes are probably best. I personally hate using them, because I hate coding them. If you can code them, use them.
Also, as Vlad said, it makes managing multiple instances of the class object, easier.
E.G if you are making forum software. You should use classes, but it is not necessary.
Curious as to why I was rated dumb for agreeing and offering an opinion.[/QUOTE]
I agree with this.
[QUOTE=voodooattack;18040023]I agree, and after some thinking, perhaps I could initially write an external editor in C# or something, since it'll need a lot of GUI work.
Later on, a good step would be to rewrite it as an in-game editor, allowing the user to design and script the bot, interactive debugging support is also a possibility.
But that move won't happen until the project becomes relatively stable; I'll have to write lots of GUI code that runs on top of SFML/OpenGL, [url=http://code.google.com/p/sfui/]this[/url] looks promising though.[/QUOTE]
Nice, I like the sound of your project. My ant game is a programmable game aswell. But yeah you will definitely need an editor for the bot designs.
SFML has python bindings :O How is this dumb?
[QUOTE=r4nk_;18040043]Nice, I like the sound of your project. My ant game is a programmable game aswell. But yeah you will definitely need an editor for the bot designs.[/QUOTE]
Thanks, Love your project by the way; when I first saw the videos, I thought you were using neural networks to control them, but that's me, always shoving a neural net at any problem I'm presented with. :buddy:
That's why I thought I'd do a project with traditional scripting involved, to get my mind out of that vortex.
Here's something that I think might interest you though: [url=http://www.biologic.com.au/bugbrain/]bugbrain[/url]
I linked that game because at advanced levels, you design the neural network for an ant; this includes locomotion, synchronizing the motion of legs, and following scents.
One of the few games that took me weeks to beat, but I have to admit that I enjoyed every moment I spent designing my ultimate critters of doom.
[QUOTE=MiniManz;18039859]So...PvP Pokemon?
My god how has no one done this before. Once it's released, I'll worship you.[/QUOTE]
Yeah PvP, but with the full standard adventure stuff too, on a pretty large map.
The project is currently on hold, however :(
Can I ask why everyone uses XML for [I]everything[/I]?(!)
This is a real bugbear/pet hate for me. XML is a [B]MARKUP[/B] language. Sorry to get massively pedantic, but wikitionary says that markup is "The notation that is used to indicate how text should be displayed". It does not mention anything about data storage, or network protocols or any of the other myriad (ab)uses that XML is currently used for.
I would agree that XML is a great language for what it has been designed as (which is markup!), but for something like data storage (and the example you give with the bots - the program looks awesome, btw) wouldn't something like JSON or YAML be more compact, and easier to write: I know it's a bit irrelevant if you do add an editor, but it seems stupid to use a hammer to put a (nail was here) SCREW, GODAMIT, I MEANT SCREW in, just because it will go do the job eventually, and everyone else seems to use a hammer, when a screwdriver will do a much better job.
There are also lots of parsers available for YAML and JSON, if you don't want to write your own. I know your thing is done now, but please, everyone, for the good of the nation, indeed, the whole world, please [b]think[/b] before blindly using XML for your data needs! ;)
[B]Edit[/B]
@The Dumb rating. If anything I'm saying is obviously dumb, please inform me - I have thought about this argument, and can't see anything particularly dumb with it. If you find it dumb for a particular reason, please give me the reason, and I will try to think of a reply for it, or concede defeat, and go on to use XML all the time myself!
I myself use JSON for data saving for my IRC bot -- It's way easier to use since it's actually made for data storage.
Also JSON4Lua is teh secks.
[QUOTE=TheBoff;18041003](yes, I know that YAML calls itself a markup language, but it's not: the authors of it clearly didn't look up "markup"!)[/QUOTE]
Called.
It's name's already been "YAML ain't a markup language" for a while.
[QUOTE=thelinx;18041138]I myself use JSON for data saving for my IRC bot -- It's way easier to use since it's actually made for data storage.
Also JSON4Lua is teh secks.[/QUOTE]
More like JSON is made easy for humans to read and write and for computers to parse and generate. It still has useless bytes and will never beat a binary format in data storage.
Sorry, you need to Log In to post a reply to this thread.