GPWiki.org
GPWiki.org
It is currently Fri May 24, 2013 6:01 pm

All times are UTC




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: FreeRCT project
PostPosted: Mon May 28, 2012 5:27 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
Today my FreeRCT program showed moving guests appearing at the edge of the park-world for the first time....

It's ALIVE!!

http://youtu.be/FzFXQjSxJZw

I am sure, it's nothing new for you guys/girls, but I usually write boring command-line compile, where the highlight is that they spit out a new file. This is a quite different ball-game :D

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Mon May 28, 2012 9:06 pm 
Grand Optimizer
User avatar

Joined: Mon Jan 17, 2005 6:01 pm
Posts: 352
Location: Canada
Nice work! Keep it up!

btw, you just gave me an idea for a really twisted game. lol

_________________
"None are more hopelessly enslaved than those who falsely believe they are free."
"It is no measure of health to be well adjusted to a profoundly sick society."
"Hope is the first step on the road to dissapointment." -Jonah Orion
http://tankzgame.blogspot.com


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Tue May 29, 2012 6:37 am 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6719
Location: Oxford, Englandshire
What you have so far looks pretty solid. Bring on the rides!

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Tue May 29, 2012 2:26 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Crazy to see new videos! :thumbs

_________________
"Life finds a way." - Ian Malcolm
My WebBlog: PixelDeveloper
English is not my native language, so excuse me for any writing mistakes.


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Tue May 29, 2012 3:40 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Just an idea that came to my mind:

To make the objects(roller-coasters, carousel, etc) of the game, you could make a XML (data)file which will show the list of the objects with their properties. This way, you could make packages without change the source-code of the game.
For example:
Code:
<?xml version="1.0"?>
<ObjectList title="Objects of the game">
    <Object>
      <title>RollerCoaster 1</title>
      <type>TRACK</type>
      <funlevel>1</funlevel>
      <vomitpotential>2</vomitpotential>
      <BitmapOfSprites> PUT HERE WHERE THE BITMAP IS </BitmapOfSprites>
      <PartList>
        <part name="normal track" x="0" y="0" width="32" height="32"/>
        <part name="oblique track" x="32" y="32" width="32" height="32"/>
        <part name="station track" x="64" y="64" width="32" height="32"/>
        ...
      </PartList>
    </Object>

    <Object>
      <title>RollerCoaster 1</title>
      <type>INTEGRAL</type>
      <funlevel>1</funlevel>
      <vomitpotential>0</vomitpotential>
      <BitmapOfSprites> PUT HERE WHERE THE BITMAP IS </BitmapOfSprites>
      <PartList anim="0">
        <part name="carousel body" x="0" y="0" width="32" height="32"/>
        ...
      </PartList>
      <PartList anim="1">
        <part name="carousel body" x="32" y="32" width="32" height="32"/>
        ...
      </PartList>
      <PartList anim="3">
        <part name="carousel body" x="64" y="64" width="32" height="32"/>
        ...
      </PartList>
    </Object>
   
</ObjectList>


Inside the XML you say which type of object is. If the object is TRACK, then the build mode will be something like the rollercoaster-building-mode or track-mode. If the object is INTEGRAL, then the player just need to put the object somewhere. So, you will need to implement algorithms for each type inside the game source-code, but will not need to implement an build mode for EACH object in game. This way, you can create a large variety of object in less time.

The "PartList anim="0"" indicates the frame of the animation. The same thing I did in the carousel object, could be done in the rollercoaster.

TA-DAAAHHH

;)

_________________
"Life finds a way." - Ian Malcolm
My WebBlog: PixelDeveloper
English is not my native language, so excuse me for any writing mistakes.


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Tue May 29, 2012 8:53 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
Thanks all for the support.

@Codehead: That's the next major thing, but a lot has to happen before that is realized. Minor issues like a "money" concept, and finding a shop/ride, and buying a ticket :p

@Meneliki: Haha, can I claim copyright??? :D

@FelipeFS: :D
like http://code.google.com/p/freerct/source ... reerct.xml ?
It does not have rides yet, but all the oher stuf I currently load is there :)

Definition of the data is http://code.google.com/p/freerct/source ... uctdef.xml , and the description in restructured text http://code.google.com/p/freerct/source ... format.rst just in case you want to read about it :)

The idea is as you suggested, I make code for each type of object not for the objects themselves. I take it one step further though, OTHER people can make their graphics, and define the properties, and then build a RCD data file that can be loaded into the program and get used. The default set is nothing more than just a bunch of RCD files too.

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Wed May 30, 2012 4:16 am 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Oh man, why didn't I used XML for my game engine?!

That is awesome, dude. I wish I could help you with your project, but I am not very familiarized with python.

_________________
"Life finds a way." - Ian Malcolm
My WebBlog: PixelDeveloper
English is not my native language, so excuse me for any writing mistakes.


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Wed May 30, 2012 5:46 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
The xml data is the 2nd generation, the 1st generation was plain Python code, so I made some progress in abstracting the structure :p

I am however not very happy about it, mostly because the structure definitions are not powerful enough. I have to create Python equivalents for each 'primtive' type in it. That cannot be right ;p
It looks like a solvable problem, but I cannot be bothered to go and fix it, data structures about bits and bytes are so unbelievably boring :(

So it'll get worse, and when the mess is big enough, I'll throw it all away, and write the 3rd generation implementation :p


As for Python, only the RCD data file generation code is in Python, the program itself is all C++ ;)

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Wed May 30, 2012 7:40 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Talking about binary mode... No matter what you choose, between text-mode or binary-mode to write your files, it is always a double-edged sword.

For example, in my data file, which I store maps, I have the following map 4x4:
Code:
[0.1,  0.0,  2.0, 3.0,
 10.1, 0.20, 3.0, 3.0,
 0.1,  0.0,  2.0, 3.0,
 0.1,  0.0,  2.0, 3.0 ]
// the number before the dot is the Y of the tile, after the dot is the Y;

It is text mode, and it is good when the number of digits is small, "2" for example has 1 digit. This means that I'm using only 1 byte. But, if the number of digits is large, like "5435734", you will use 7 bytes for an integer, which could use only 4 bytes.

XML has the "<![CDATA[", which allows you to put a binary code inside the structure. It is like a binary-mode inside a text-mode file. But, WHO guarantees that inside your binary-code will not have an sequence of "]]>"???

Text-mode can be more expensive, but is more secure. BUT and idea to prevent the problem above is to put the size of the binary-code(inside the text-mode file) to read before start the reading.

Alberth wrote:
I have to create Python equivalents for each 'primtive' type in it. That cannot be right ;p

When you say that, you mean something like this: XML to Python data structure (Python recipe)?

_________________
"Life finds a way." - Ian Malcolm
My WebBlog: PixelDeveloper
English is not my native language, so excuse me for any writing mistakes.


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Thu May 31, 2012 7:56 am 
Shake'n'Baker

Joined: Sun May 27, 2012 6:01 pm
Posts: 62
May i just suggest that if you intend on using XML, to separate your classes from your instance(s) data.

As XML is used to transfer data from within an object, you may find it easier to keep your classes within your project. If not, having one feed of XML holding your meta-classes, and one for the instance data will make your life alot easier.

Things like "funlevel", "vomitpotential" and "BitmapOfSprites" would most likely be within class.
(I suspect funlevel and vomitpotential would be calculated at runtime too?)

And XML does not support binary natively, you need to BASE64 encode into the CDATA

Good luck!
Mike Brown [cxzuk]


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Thu May 31, 2012 5:58 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
FelipeFS wrote:
Talking about binary mode... No matter what you choose, between text-mode or binary-mode to write your files, it is always a double-edged sword.
Euhm, ok :) Luckily it makes absolutely no difference what-so-ever at a Unix system, both modes are equivalent :D
(Unix uses \n in text-files, which in text mode gets translated to .... \n :D )

FelipeFS wrote:
For example, in my data file, which I store maps, I have the following map 4x4:
Code:
[0.1,  0.0,  2.0, 3.0,
 10.1, 0.20, 3.0, 3.0,
 0.1,  0.0,  2.0, 3.0,
 0.1,  0.0,  2.0, 3.0 ]
// the number before the dot is the Y of the tile, after the dot is the Y;

It is text mode, and it is good when the number of digits is small, "2" for example has 1 digit. This means that I'm using only 1 byte. But, if the number of digits is large, like "5435734", you will use 7 bytes for an integer, which could use only 4 bytes.
If that example is directly from your sources, there is a typo in it, the comment says both numbers are Y coordinates.

Other than that, I see 'text mode' as useful for files I want to be able to read, and usually edit with a text editor. Binary files are for reading by a computer. I don't want to examine them without additional tools, I use the latter as little as possible as it makes development harder. I don't really care about the size of files, 1GB disk goes for about 1 euro (at least it did several years back), so my time and convenience is more important than 3 bytes of data.

FelipeFS wrote:
XML has the "<![CDATA[", which allows you to put a binary code inside the structure. It is like a binary-mode inside a text-mode file. But, WHO guarantees that inside your binary-code will not have an sequence of "]]>"???
Where did you read you can put binary code in the CDATA block?
Afaik, an xml file is a unicode file, encoded in some char-set (usually utf-8). That means the entire file has to be valid utf-8. Arbitrary binary code is not going to play by that rule :D
The usual solution is to encode the binary data in a text-format, eg hexdigits, or base64 (as also said by cxzuk). That also takes case of your marker problem.

FelipeFS wrote:
Text-mode can be more expensive, but is more secure. BUT and idea to prevent the problem above is to put the size of the binary-code(inside the text-mode file) to read before start the reading.
Sorry, I don't understand "more secure". I do use such size prefixes, but only in binary files (adding anything binary in a file makes it a 'binary file' for me no matter how small the binary data is).

FelipeFS wrote:
Alberth wrote:
I have to create Python equivalents for each 'primtive' type in it. That cannot be right ;p

When you say that, you mean something like this: XML to Python data structure (Python recipe)?
Oh, your reference looks like the elementtree module to me :)

It is however not what I mean.
Code:
======  ======  ==========================================================
Offset  Length  Description
======  ======  ==========================================================
   0       4    Magic string 'ANSP'.
   4       4    Version number of the block '1'.
   8       4    Length of the block excluding magic string, version, and length.
  12       2    Zoom-width of a tile.
  14       1    Person type.
  15       2    Animation type.
  17       2    Frame count (called 'f').
  19      f*4   Sprite for each frame.
   ?            Variable length.
======  ======  ==========================================================
Above you see the data layout of the 'ANSP' block. Notice the word containing a count at offset 17.
This block in XML looks like
Code:
<block magic="ANSP" minversion="1" maxversion="1">
   <field name="width"       type="uint16">Zoom-width of a tile</field>
   <field name="person_type" type="PersonType">Type of persons in the animation</field>
   <field name="anim_type"   type="AnimationType">Animation being defined</field>
   <field name="frames"      type="frame_images">Sprites of the animation for a single tile width</field>
</block>
As you can see, there is no count in this definition. Instead, there is a thing called 'frame_images'. I cannot express in XML that it has a count prefix, and it contains sprite blocks (which should be counted, and used as prefix value).
Instead, I have to code a data type called 'frame_images' in Python manually that knows all this.

Another example: Tomorrow I will need to define a number of bits from a set for defining possible colours. Obviously, you can state eg 0x'3E6', but I rather have 'blue, green, light-red'. The latter is currently also not expressable in the structdef.xml file.

In other words, I am already running into limits of the data format, and have not even started doing ride data which is much more complicated.

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Thu May 31, 2012 7:30 pm 
Harmlessness does no harm
User avatar

Joined: Tue Sep 14, 2004 8:37 pm
Posts: 3809
Location: Ferriday, LA, US
Just an aside: Any game with a statistic called "vomit potential" has got to be awesome. 8) :rock

_________________
What most people don't understand about "enlightenment" is that it is not an end-goal; but where you find yourself just before taking a new "first step."


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Fri Jun 01, 2012 7:51 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
FreeRCT uses the friendlier name 'Nausea level' for that :p

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Fri Jun 01, 2012 11:04 pm 
Shake'n'Baker

Joined: Sun May 27, 2012 6:01 pm
Posts: 62
Alberth wrote:
FreeRCT uses the friendlier name 'Nausea level' for that :p


Is this your own engine?

Keep up the good work!
cxzuk


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Sat Jun 02, 2012 6:33 am 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
cxzuk wrote:
Alberth wrote:
FreeRCT uses the friendlier name 'Nausea level' for that :p


Is this your own engine?
It is.

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Sat Jun 02, 2012 6:13 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Alberth wrote:
Where did you read you can put binary code in the CDATA block?
Afaik, an xml file is a unicode file, encoded in some char-set (usually utf-8). That means the entire file has to be valid utf-8. Arbitrary binary code is not going to play by that rule :D

I'm not saying that XML allows binary-code, what I mean is that if you treat that text-code as binary by your algorithm, you gonna have problem if find a "]]>" sequence.

Mugai wrote:
Just an aside: Any game with a statistic called "vomit potential" has got to be awesome. 8) :rock

Ahahahahhaha :lol Wouldn't that be cool!?

_________________
"Life finds a way." - Ian Malcolm
My WebBlog: PixelDeveloper
English is not my native language, so excuse me for any writing mistakes.


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Sat Jun 02, 2012 6:28 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1553
Location: burrowed
Alberth wrote:
FreeRCT uses the friendlier name 'Nausea level' for that :p


I'm a fan of 'puke factor' :D

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Sat Jun 02, 2012 6:47 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
FelipeFS wrote:
Alberth wrote:
Where did you read you can put binary code in the CDATA block?
Afaik, an xml file is a unicode file, encoded in some char-set (usually utf-8). That means the entire file has to be valid utf-8. Arbitrary binary code is not going to play by that rule :D

I'm not saying that XML allows binary-code, what I mean is that if you treat that text-code as binary by your algorithm, you gonna have problem if find a "]]>" sequence.
Ah, ok, I fully agree with that!

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Sat Jun 02, 2012 7:12 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Hey Alberth, do you have pixelartists? I could help, if you give me the instructions of the palette color and image size. I'm good with pixel art(I do by myself these <<<raptors avatars)

EDIT: Also, I can make 3D models :)

_________________
"Life finds a way." - Ian Malcolm
My WebBlog: PixelDeveloper
English is not my native language, so excuse me for any writing mistakes.


Top
 Profile  
 
 Post subject: Re: FreeRCT project
PostPosted: Sat Jun 02, 2012 7:28 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
FelipeFS wrote:
Hey Alberth, do you have pixelartists? I could help, if you give me the instructions of the palette color and image size. I'm good with pixel art(I do by myself these <<<raptors avatars)

EDIT: Also, I can make 3D models :)
Thank you for the offer. There is currently another pixel artist in the project, so you should talk to him. (you can find the current sprites in /trunk/sprites_src, about 90MB of data). I'll forward your request to him.

All sprites will have to be licensed under the GPL license.

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group