I started in XNA sometime around February last year. Feels like yesterday :v:
Doing better than me, Been coding in C# since around the release of .NET 2.0.
Wish I had the ideas. I think I'll stick to clones and pointless apps. :ninja:
It seems to me that programming experience is mostly cumulative, I know that, for me, learning C++ was a long, sometimes difficult process, but now, after getting pretty comfortable with C++, I've tried out C# and python and I find that they are very easy to pick up.
The great thing about learning new languages is that they tend to reveal programming styles and features that you discover could help you with the languages you already know.
Anyone else have a similar experience?
[QUOTE=Tezzanator92;25273408]I don't think that would effect it because he is using "StartsWith()" for "#", Point stands for pipe and new line though.[/QUOTE]
That would be dumb because then you cant have
I|name|12 #describe it a bit here
[img]http://imgur.com/QiPaf.png[/img]
Grain? Pl0x?
I really want to play it :P
[QUOTE=DevBug;25278786][img_thumb]http://imgur.com/QiPaf.png[/img_thumb]
Grain? Pl0x?[/QUOTE]
Seriously no it's not funny
[img]http://3alleypub.files.wordpress.com/2008/03/beating_a_dead_horse.jpg[/img]
Working on a very simple tile based map editor for a game I'm also working on. Hopefully will figure out a better map format later on.
[img]http://jmazouri.com/pubfiles/zestedit.jpg[/img]
[QUOTE=jmazouri;25280396]Working on a very simple tile based map editor for a game I'm also working on. Hopefully will figure out a better map format later on.
[img_thumb]http://jmazouri.com/pubfiles/zestedit.jpg[/img_thumb][/QUOTE]
I use xml for maps, it's awesome:
[CODE] <?xml version="1.0" encoding="utf-8" ?>
- <level>
- <meta>
<name>test</name>
<width>40</width>
<height>40</height>
</meta>
- <content>
- <tile>
<pos>0 0</pos>
<texture>dbg1</texture>
<collidable>true</collidable>
</tile>
- <tile>
<pos>-600 -100</pos>
<texture>dbg1</texture>
<collidable>true</collidable>
</tile>
</content>
</level>[/CODE]
Seriously now?
:colbert:
[editline]09:48AM[/editline]
I mean people rip on XML more than it deserves on this forum but really for map data it is a terrible choice. Or at least the XML code above is a terrible way for map data. You could use it to store the data for each tile type then have the map data as a block of data such as numbers or something. But doing it like above where each individual tile is 5 lines long and contains the name of the texture in it (lots of redundant data..) is pretty much not okay.
[QUOTE=r4nk_;25280805]Seriously now?
:colbert:
[editline]09:48AM[/editline]
I mean people rip on XML more than it deserves on this forum but really for map data it is a terrible choice. Or at least the XML code above is a terrible way for map data. You could use it to store the data for each type type then have the map data as a block of data such as numbers or something. But doing it like above where each individual tile is 5 lines long and contains the name of the texture in it (lots of redundant data..) is pretty much not okay.[/QUOTE]
It works, is easily human readable and is not slow to load, why complain?
I might change it like this to make it a bit nicer tho
[CODE]
<level>
<tile pos="32 32" texture="dbg1" collidable="true" layer="1" />
</level>
[/CODE]
[QUOTE=Pirate Ninja;25281544]It works, is easily human readable and is not slow to load, why complain?
I might change it like this to make it a bit nicer tho
[CODE]
<level>
<tile pos="32 32" texture="dbg1" collidable="true" layer="1" />
</level>
[/CODE][/QUOTE]
You missed my point completely, the problem is that it's [i]not human readable[/i]. A file isn't human readable just because it's formatted in XML, or made of readable characters. To be human readable you have to be able to easily understand and interpret the information. Using your map format, a real map would have lets say 256x256 tiles in dimension = ~65000 lines. Seriously that is not a human readable format. And if it's not human readable you aren't using XML properly and you might as well just not use XML. You cant read the file and understand. But if you have the file more like this:
[code]
<level name="My awesome level">
<tiletype value=0 collidable=false>
<image>grass.jpg</image>
</tiletype>
<tiletype value=1 collidable=true>
<image>wall.jpg</image>
</tiletype>
<data>
11111111111111
10000000000001
10000000000001
11111111111111
</data>
</level>[/code]
That is at least human readable to some extent, makes more sense and has less redundant data...
[QUOTE=r4nk_;25281859]You missed my point completely, the problem is that it's [i]not human readable[/i]. A file isn't human readable just because it's formatted in XML, or made of readable characters. To be human readable you have to be able to easily understand and interpret the information. Using your map format, a real map would have lets say 256x256 tiles in dimension = ~65000 lines. Seriously that is not a human readable format. And if it's not human readable you aren't using XML properly and you might as well just not use XML. You cant read the file and understand. But if you have the file more like this:
[code]
<level name="My awesome level">
<tiletype value=0 collidable=false>
<image>grass.jpg</image>
</tiletype>
<tiletype value=1 collidable=true>
<image>wall.jpg</image>
</tiletype>
<data>
11111111111111
10000000000001
10000000000001
11111111111111
</data>
</level>[/code]
That is at least human readable to some extent, makes more sense and has less redundant data...[/QUOTE]
What if i have more than 99 textures? what if i have a tile with the number 1 and i sometimes want it to be collidable and sometimes not? make 2 things with the same texture, that's redunant too.
Then you do a collision mask or something. And you can seperate mapdata:
[code]
01|02|02|02|01|
01|02|02|02|01|
01|02|02|02|01|
01|02|02|02|01|
01|01|01|01|01|
01|00|00|00|01|
01|00|00|00|01|
01|01|01|01|01|
[/code]You'd use the 0s just to keep the text aligned ofc.
[QUOTE=Jawalt;25282048]Then you do a collision mask or something. And you can seperate mapdata:
[code]
01|02|02|02|01|
01|02|02|02|01|
01|02|02|02|01|
01|02|02|02|01|
[/code]
You'd use the 0s just to keep the text aligned ofc.[/QUOTE]
I get you guys, probably gonna replace the xml with some really simple binary format completly. I feel so retarded for thinking xml was a good choice for levels.
IMO XML is good for nothing. If you really need some nestable markup, use JSON.
AnyHub 1.4 for iOS
[media]http://www.youtube.com/watch?v=xr-CAbnm9bo[/media]
Changelog:
[code]+ Share via SMS/MMS
+ Take picture from in-app
+ Progress bar to track how much of your file has been uploaded
+ Fast app switching support
+ Facebook and Website link in credits/info
- Lots of bug fixes
-- Network connectivity monitoring
-- Failed file upload monitoring
-- Retina display background image fix (iOS 4)
[/code]
Any comments, ideas, or suggestions?
[editline]09:23PM[/editline]
I am a tool.
[img]http://i51.tinypic.com/iwm9oi.png[/img]
It's getting slightly more dangerous
I'm dropping SVN for Git and PHP for RoR; both make my life easier.
[QUOTE=high;25278564]That would be dumb because then you cant have
I|name|12 #describe it a bit here[/QUOTE]
That i know, as i said in a previous post, it's currently just a temporary way of doing it, gonna make a better one.
[QUOTE=NovembrDobby;25277634]I started in XNA sometime around February last year. Feels like yesterday :v:[/QUOTE]
Same here but with C# :buddy:
[editline]07:14PM[/editline]
[QUOTE=Jallen;25268645]Was talking to BAZ and he was saying how the comic is outdated, so I edited it to better suit WAYWO in its current state.
[img]http://ahb.me/Bbu[/img][/QUOTE]
omg leaking gmf content ban
[QUOTE=Xeon06;25282998]IMO XML is good for nothing. If you really need some nestable markup, use JSON.[/QUOTE]
I use XML for my material files:
[code]<?xml version="1.0" ?>
<Material>
<Filename>materials/notex.png</Filename>
<ForcedQuality>Medium</ForcedQuality>
<Mipmap>False</Mipmap>
<Alpha>None</Alpha>
<Format>PNG</Format>
</Material>[/code]
And also my binds file:
[code]<?xml version="1.0" ?>
<Binds>
<bind id="223" down="toggleconsole" />
</Binds>[/code]
And I'll probably bind it into Lua and use it for settings file. It suits my purpose fine, tt's fast to load, it's human readable. There's nothing wrong with this setup, and I'm not going to change it.
[QUOTE=ralle105;25270790]You got some z issues on the gun:ohdear:[/QUOTE]
do you mean zenable?
[QUOTE=thomasfn;25287271]I use XML for my material files:
[code]<?xml version="1.0" ?>
<Material>
<Filename>materials/notex.png</Filename>
<ForcedQuality>Medium</ForcedQuality>
<Mipmap>False</Mipmap>
<Alpha>None</Alpha>
<Format>PNG</Format>
</Material>[/code]
And also my binds file:
[code]<?xml version="1.0" ?>
<Binds>
<bind id="223" down="toggleconsole" />
</Binds>[/code]
And I'll probably bind it into Lua and use it for settings file. It suits my purpose fine, tt's fast to load, it's human readable. There's nothing wrong with this setup, and I'm not going to change it.[/QUOTE]
Well of course it all comes down to opinion and personal preferences. We can't impose our choices onto others, merely suggest.
[QUOTE=thomasfn;25287271]There's nothing wrong with this setup[/QUOTE]
But that's entirely subjective. Personally I think your setup is awful.
Here's the equivalent JSON:
[lua]
{
"Filename": "materials/notex.png",
"ForcedQuality": "Medium",
"Mipmap": false,
"Alpha": "None",
"Format": "PNG"
}
[/lua]
Your XML document is 195 bytes, the JSON version is only 121 bytes... for the exact same data. The XML version has a considerable amount of unnecessary noise. The JSON version also retains the type of that one boolean, which is a nice extra.
XML is a markup language, that is, it's meant for annotations, not data serialization. Notice how your XML version uses almost none of the many features of XML, while the JSON versions uses about half of the JSON format (Only arrays, numbers and null not being covered).
I think your material format, though small, is actually a very good example of XML abuse.
edit:
And since you're already embedding Lua, why not just make it:
[lua]
Filename = "materials/notex.png"
ForcedQuality = "Medium"
Mipmap = false
Alpha = "None"
Format = "PNG"
[/lua]
I'm pretty sure the additional 74 bytes is not going to harm anyone. It would be better if I removed the <Material></Material> tags and the version though, but that's down to the implementation of XML reader I'm using.
I do realise my data does not use many of the features of XML, and perhaps you're right when you say XML is designed for markup and not data serialization, but I don't need to use any other features of XML for a simple string -> value list. Of course you're going to argue that if I knew I wasn't going to use most of XML features, then I should have picked JSON from the start. Well, I've made my choice, and I'm not regretting it, and there's no point unimplementing something just to implement something else for no benefit.
And although I am embedding Lua, the point is that the c++ engine will handle everything to do with materials - the Lua scripts just point the engine to the name of the material and the engine will locate the xml file and parse everything.
[editline]01:57PM[/editline]
I do agree that <Filename>Blah</Filename> is wasteful though, maybe I should change it into <Filename="Blah"> or something (can you do that in xml?)
<Filename="Blah"/>
[QUOTE=thomasfn;25288678]
I do agree that <Filename>Blah</Filename> is wasteful though, maybe I should change it into <Filename="Blah"> or something (can you do that in xml?)[/QUOTE]
You can't. You could abuse attributes by doing it like:
[code]<Filename value="Blah"/>[/code]
But it doesn't scale very well and it looks really stupid.
XML is simply the wrong tool for the job here.
[QUOTE=jA_cOp;25288210]But that's entirely subjective. Personally I think your setup is awful.
Here's the equivalent JSON:
[lua]
{
"Filename": "materials/notex.png",
"ForcedQuality": "Medium",
"Mipmap": false,
"Alpha": "None",
"Format": "PNG"
}
[/lua]
Your XML document is 195 bytes, the JSON version is only 121 bytes... for the exact same data. The XML version has a considerable amount of unnecessary noise. The JSON version also retains the type of that one boolean, which is a nice extra.
XML is a markup language, that is, it's meant for annotations, not data serialization. Notice how your XML version uses almost none of the many features of XML, while the JSON versions uses about half of the JSON format (Only arrays, numbers and null not being covered).
I think your material format, though small, is actually a very good example of XML abuse.
edit:
And since you're already embedding Lua, why not just make it:
[lua]
Filename = "materials/notex.png"
ForcedQuality = "Medium"
Mipmap = false
Alpha = "None"
Format = "PNG"
[/lua][/QUOTE]
What JSON parser do you recommend for C++?
[QUOTE=AtomiC0l;25289514]What JSON parser do you recommend for C++?[/QUOTE]
Sorry, I've never used JSON for C++. For C I use [url=http://lloyd.github.com/yajl/]yajl[/url] for its notorious parsing speed, but I bet there's a bunch of good C++ JSON parsers out there that are a lot easier to use.
Sorry, you need to Log In to post a reply to this thread.