Guys, what do you think of my map file format? I haven't started writing a loader yet, but I want to see if it's good. Note: strings are prefixed by their length and are not null terminated. It's in the order it would be in a file
Header:
int: engine version
int: game id (0 is works with all)
string: mapname
World Property s(gravity, etc): Can be as many as you want, just need to end the list with a 0. Each is a string with the property name, then a byte with the type (byte, int, float, string, bool)
int: number of entites to read
Entites:
string: ent type (think prop_static and such)
property's(x, y, image): same format as world propertys
ending byte: (a 0)
Major rewrite done. I feel so accomplished! :D
[QUOTE=neos300;29004146]Guys, what do you think of my map file format? I haven't started writing a loader yet, but I want to see if it's good. Note: strings are prefixed by their length and are not null terminated. It's in the order it would be in a file
Header:
int: engine version
int: game id (0 is works with all)
string: mapname
World Property s(gravity, etc): Can be as many as you want, just need to end the list with a 0. Each is a string with the property name, then a byte with the type (byte, int, float, string, bool)
int: number of entites to read
Entites:
string: ent type (think prop_static and such)
property's(x, y, image): same format as world propertys
ending byte: (a 0)[/QUOTE]
What if a property has the literal value of 0?
You should prepend magical bytes to the header, so you can easily spot the file format.
I don't think you really need a game id, one id should be enough. And engine version should probably be map format version or something alike.
If you're considering to make that format available to the public then the game ids would probably easily be falsely taken; if you really want it to somehow identify itself to some game, perhaps use a string, which usually is the games name.
The entity-type as a 16-bit number should be enough. And you should be able to deduce the number and order of properties from the entity type. If you think you can save enough bytes to make it worth not including default values, then you could use ids for the property as well, as opposed to strings.
The same with world properties.
Also, are only bytes or multiple thereof supported? And how many bits is the number for specifying the length of strings?
I'm rethinking the way health will work in my game.
If anyone remembers that game ideas megathread or whatever, that guy obsessed with Haskell made a post about simulating stress. I think I'll have no health, but instead simulate your player's heartbeat.
When you get shot your heartbeat will speed up, also when running. If your heartbeat gets too fast, it will affect your accuracy and movement speed. If it gets way too fast, you can have a heart attack and die. As long as you keep your heartbeat above zero, you stay alive.
[QUOTE=ZenX2;29005180]I'm rethinking the way health will work in my game.
If anyone remembers that game ideas megathread or whatever, that guy obsessed with Haskell made a post about simulating stress. I think I'll have no health, but instead simulate your player's heartbeat.
When you get shot your heartbeat will speed up, also when running. If your heartbeat gets too fast, it will affect your accuracy and movement speed. If it gets way too fast, you can have a heart attack and die. As long as you keep your heartbeat above zero, you stay alive.[/QUOTE]
That's a nifty idea, but I don't think we need any more regenerating health FPSs. Also, having a heart attack from a bullet shot is kind of unusual.
I'm making a wave based tower defense based box head like zombie shooter.
The first turret circle thing at the bottom acts as a button to choose the turret you want.
These arent final turret or enemy graphics but just something to use. The player graphics are most likely staying.
Didn't know how to make the mouse cursor show up, but its a little crosshair, and thats where the player is always pointing to.
[media]http://www.youtube.com/watch?v=7lwExXllyI4[/media]
First time I recorded my desktop and compressed it 5 different times to upload it to youtube. I feel accomplished.
[QUOTE=ZenX2;29005180]I'm rethinking the way health will work in my game.
If anyone remembers that game ideas megathread or whatever, that guy obsessed with Haskell made a post about simulating stress. I think I'll have no health, but instead simulate your player's heartbeat.
When you get shot your heartbeat will speed up, also when running. If your heartbeat gets too fast, it will affect your accuracy and movement speed. If it gets way too fast, you can have a heart attack and die. As long as you keep your heartbeat above zero, you stay alive.[/QUOTE]
If you're going to simulate heart rate, I'd suggest simulating blood pressure and loss too. Afaik, there's a couple ways you can die due to being shot and a couple of them involve loosing blood or having some sort of internal bleeding. That's an awesome idea, btw. I've always hated the whole "health is simply a number" thing.
I've already mostly converted it over, along with a cool healthbar that instead of shrinking flashes with your heartbeat :3:
Blood pressure is definitely the next thing to add, heartrate alone is not enough.
There will be many more factors that influence your heartrate than bullets, like sprinting, but in the end, death will come down to heartrate.
[QUOTE=grlira;29005731]If you're going to simulate heart rate, I'd suggest simulating blood pressure and loss too. Afaik, there's a couple ways you can die due to being shot and a couple of them involve loosing blood or having some sort of internal bleeding. That's an awesome idea, btw. I've always hated the whole "health is simply a number" thing.[/QUOTE]
Roll on the defibrillator perk / unlock. Similar to how Crysis 2 does it
The bloodloss is awesome, it already feels revolutionary. When you get shot, it increases you bloodloss and gives a small spike to your heartrate. When you have bloodloss, your heartrate slows over time, and your bloodloss decreases over time with a regeneration coefficient. :buddy:
[editline]5th April 2011[/editline]
It's pretty realistic; if you're shot 5 times you'll die pretty quickly.
[editline]5th April 2011[/editline]
Resistance now changes how resistant you are to bloodloss and heartrate change, makes stronger/weaker enemies easier to make.
[QUOTE=Jallen;29002515]How're you simulating so many particles? There must be thousands there.
I've always wondered that about sand games.[/QUOTE]
The simplest thing to do is store the game world as a bitmap, loop over each pixel every frame and, using some fast bitmap data read/set commands, "update" each pixel depending on its colour. You can make it slightly more flexible by using an array of particle types or whatever, but the basic concept is the same.
[QUOTE=ThePuska;29002971]Why do the particles appear to spread while falling? Do they exhibit some kind of random motion, or do you simulate them correctly in a Newtonian way? Or is it some kind of an illusion
[editline]6th April 2011[/editline]
Not that it's a bad thing. It just seems nonstandard for a simple falling sand game that updates the world as a grid. Seems like it would be a result of particles gaining momentum or something.[/QUOTE]
The spread is implemented as random x-direction movement each frame, usually only being applied if there is another particle below the particle current being update. This is just done to make the sand spread out correctly once it starts stacking up.
... Yeah I used to be a massive Falling Sand Game enthusiast, I spent hours on WxSand and Burning Sand, as well as a long time making my own sand simulator.
[media]http://i.imgur.com/ciEWD.png[/media]
Lots of new stuff supported. Most formatting works. Querying loosely works. Largely a case of going through all the possible commands and implementing ones I need at the moment. (Topic stuff in the query window is a bug)
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/RawFile/FrameworkReady.png[/img]
I mostly finished the framework for the file info tool, now it just needs a name that isn't already taken. (Help?)
Overv, is it OK if I put this on GitHub (under the GPL with an additional permission so that plugins can use closed-source .dlls if necessary)? It was your idea after all...
I had a bit of an idea for something we could do... kinda like one of those photoshop collaboration things that go on over in the artsy section of the forums.
Basically I'll start of with some basic code to get a window open and ready to draw on and, for example, draw a rotating hexagon. I then post the code and the next person downloads it and "reserves" his or her spot for that contribution. Basically people will just keep adding stuff and it'll turn into some crazy WAYWO-ified graphics-y thing. Obviously there will have to be rules, for example the code can't be completely non graphics-related (delete all files in system32 ETC) and so on.
What does everyone think? I'm sure some people will try to ruin it, but I think a few of us could have quite a good time!
If it does go ahead, we'll have to pick a language (and any libraries) carefully enough that everyone has an easy chance at having a go.
[QUOTE=Chris220;29006903]If it does go ahead, we'll have to pick a language (and any libraries) carefully enough that everyone has an easy chance at having a go.[/QUOTE]
This is the biggest problem, I think: finding the right language + libraries. We'd never agree on it. And even then without some kind of direction I think it would just end up as a mess of code.
/pessimism
It could still work, though. :v:
[QUOTE=ZeekyHBomb;29004990]What if a property has the literal value of 0?
You should prepend magical bytes to the header, so you can easily spot the file format.
I don't think you really need a game id, one id should be enough. And engine version should probably be map format version or something alike.
If you're considering to make that format available to the public then the game ids would probably easily be falsely taken; if you really want it to somehow identify itself to some game, perhaps use a string, which usually is the games name.
The entity-type as a 16-bit number should be enough. And you should be able to deduce the number and order of properties from the entity type. If you think you can save enough bytes to make it worth not including default values, then you could use ids for the property as well, as opposed to strings.
The same with world properties.
Also, are only bytes or multiple thereof supported? And how many bits is the number for specifying the length of strings?[/QUOTE]
A property is always read, even if it is 0 it just is read and it moves to the next property. Property's don't end with 0.
What are magical bytes?
The game id isn't anti-piracy, it's just to keep the game from crashing from not having the proper entites.
The entity types are defined as strings in the engine, and this map editor isn't constrained to one game, it's used for all games made with this engine, and it needs to be dynamic.
Again, the map editor doesn't know about the property's of entites, it doesn't assume anything about them. I should have put an etc. in that property list, there are many more (you could have infinite, the property map is transformed into a std::map)
'Also, are only bytes or multiple thereof supported?' Not really understanding what you are getting at here.
The string length is 8 bits (a byte) so the strings are limited to 255 characters.
[QUOTE=Chris220;29006903]I had a bit of an idea for something we could do... kinda like one of those photoshop collaboration things that go on over in the artsy section of the forums.
Basically I'll start of with some basic code to get a window open and ready to draw on and, for example, draw a rotating hexagon. I then post the code and the next person downloads it and "reserves" his or her spot for that contribution. Basically people will just keep adding stuff and it'll turn into some crazy WAYWO-ified graphics-y thing. Obviously there will have to be rules, for example the code can't be completely non graphics-related (delete all files in system32 ETC) and so on.
What does everyone think? I'm sure some people will try to ruin it, but I think a few of us could have quite a good time!
If it does go ahead, we'll have to pick a language (and any libraries) carefully enough that everyone has an easy chance at having a go.[/QUOTE]
Considering it's ease of use, the fact that most people know it or can pick it up easily, Visual Studio making compiling a doddle and it's massive number of inbuilt libraries, C#? [/C# fanboy]
Added caching to my serialize class. It caches a list of the members for each type. That way every time you serialize, it is not filtering out the members that don't need to be serialized along with sorting the list. Plus it makes the serialize function a lot cleaner.
[csharp]public virtual void Pack(Stream s)
{
List<FieldInfo> fields = Caching ? GetCache(GetType()) : GetMembers(GetType());
foreach (FieldInfo field in fields)
{
Pack(s, field.GetValue(this));
}
}[/csharp]
[QUOTE=knighty;29007306]Considering it's ease of use, the fact that most people know it or can pick it up easily, Visual Studio making compiling a doddle and it's massive number of inbuilt libraries, C#? [/C# fanboy][/QUOTE]
Entirely possible :P
My C++ fanboy self is naturally rebelling, but I'm really up for anything. I just wanna see how this turns out!
Made a certain amount of bloodloss also kill you, it was getting a bit unrealistic, but now it's good again.
I've started hacking on my build system again. Part of the "new shiny stuff" is trying to get the time spent checking if a file or its dependencies has changed. So, I need to dump some of the python only code into the C side.
The Python extending API isn't too bad (though I question some of their methods), but part of what I'm doing means I want to take advantage of grand central dispatch on OS X (concurrency all up in this). However, this doesn't mean I should lock people in per platform. So I'm trying to allow for a fall back (via pthreads, and fauxroutines). This means I need to know when the OS X version is above 10.6 or not. So I wrote a quick little one-liner to check.
[code]
>>> import platform
>>> float('.'.join(platform.mac_ver()[0].split('.')[:-1])) >= 10.6
True
[/code]
[i][b]What have I done?![/b][/i]
[sp]In hindsight, I could just do int(platform.mac_ver()[0].split('.')[1]) >= 6. It's still disgusting[/sp]
[QUOTE=Chandler;29008260]I've started hacking on my build system again. Part of the "new shiny stuff" is trying to get the time spent checking if a file or its dependencies has changed. So, I need to dump some of the python only code into the C side.
The Python extending API isn't too bad (though I question some of their methods), but part of what I'm doing means I want to take advantage of grand central dispatch on OS X (concurrency all up in this). However, this doesn't mean I should lock people in per platform. So I'm trying to allow for a fall back (via pthreads, and fauxroutines). This means I need to know when the OS X version is above 10.6 or not. So I wrote a quick little one-liner to check.
[code]
>>> import platform
>>> float('.'.join(platform.mac_ver()[0].split('.')[:-1])) >= 10.6
True
[/code]
[i][b]What have I done?![/b][/i]
[sp]In hindsight, I could just do int(platform.mac_ver()[0].split('.')[1]) >= 6. It's still disgusting[/sp][/QUOTE]
Only disgusting part is the lack of checks.
[QUOTE=high;29008744]Only disgusting part is the lack of checks.[/QUOTE]
What checks? The code posted was test code from the REPL. Any checks would be useless in this case.
[QUOTE=knighty;29007306]Considering it's ease of use, the fact that most people know it or can pick it up easily, Visual Studio making compiling a doddle and it's massive number of inbuilt libraries, C#? [/C# fanboy][/QUOTE]
Why would the development environment matter? You just have to pick the language. If your project depends on a particular IDE, that's really weird.
I'd say C++ and SFML, simple cross platform well known library + a not so simple language with compilers for a FUCKTON of platforms.
[img]http://i54.tinypic.com/2u4nihd.png[/img]
Terrain generation is coming along nicely.
Amazing!
[img]http://i53.tinypic.com/2m3mrsn.png[/img]
Something that looks partly decent, I'm not going to stick to that style of programmer art, I'll probably make them more suitable for my game once I finish the basic things.
It's only really impressive to me because SFML doesn't have tiling textures by default, so I feel sort of successful for getting tiling textures in SFML :)
[QUOTE=NorthernGate;29011520][img_thumb]http://i53.tinypic.com/2m3mrsn.png[/img_thumb]
It's only really impressive to me because SFML doesn't have tiling textures by default, so I feel sort of successful for getting tiling textures in SFML :)[/QUOTE]
I'm pretty sure that if you suggest it on the forum, he'll add it in for his 2.0 release. Laurent is pretty flexible when it comes to adding requests from people on the forum.
[QUOTE=AtomiC0l;29013084]I'm pretty sure that if you suggest it on the forum, he'll add it in for his 2.0 release. Laurent is pretty flexible when it comes to adding requests from people on the forum.[/QUOTE]
I remember reading a thread on the SFML forums about textured shapes, and he said he'd consider them, which would cover the tiling textures feature as well. Thanks though :)
Sorry, you need to Log In to post a reply to this thread.