GPWiki.org
GPWiki.org
It is currently Sun May 26, 2013 12:50 am

All times are UTC




Post new topic Reply to topic  [ 76 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Mon Jan 09, 2012 4:25 am 
Grand Optimizer
User avatar

Joined: Mon Jan 17, 2005 6:01 pm
Posts: 352
Location: Canada
That looks pretty cool, once you're done do you plan to create a game with it? I'd love to see it in action!
good work, keep it up! :)

_________________
"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  
 
PostPosted: Mon Jan 09, 2012 4:32 am 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Jimbo wrote:
That looks pretty cool, once you're done do you plan to create a game with it? I'd love to see it in action!
good work, keep it up! :)


Definitely! :) But there is still a long path to walk.

EDIT: For those ones who are curious about the game source-code and the syntax, here is the document at GoogleDocs(no sign-in required): https://docs.google.com/document/d/1rW8nem1lsx-Re6eThJKZez3Z1tFhRYkdZcJ7zDI6LPU/edit

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


Top
 Profile  
 
PostPosted: Mon Jan 09, 2012 1:28 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1553
Location: burrowed
FelipeFS wrote:
I did not understood what exactly you pointed to about the size. If it is about the 256x256 size, this size is the size loaded in the game project file, the user can change it. If it is about the interface, the left frame, called "Game Engine - Manager" can be hidden, increasing the size of the screen.


So the map and tilesize are dynamic. that is good. I would advise not to restrict them in the project creation either though, it would suck to run into the map boundary if you're designing a map. you should have a way to increase those on the fly in either direction.

FelipeFS wrote:
if you mean the rectangles(and that coordinates) drawn every tile in the map, they are only for test.

It is the second complaint about the way the interface looks. Definitely I'll try to give it a better look and improved it.


It is not about the rectangles and not about the looks. The coordinates can be handy, especially if you can trigger them on and off, so keep that. I meant if i look at it and try to imagine how it would be used, it looks frustrating. Creating a level with a tile editor is a LOT of effort. There's usually so many different tiles and different layers that you should increase usability where you can.

Have you thought about adding tools like dragging boxes and floodfill them with a single tile? Or creating stamps from objects that have several tiles in the tilemap to get easily pasted into the actual map?

thats why i said you should build testmaps and see how it works out and where you feel uncomfortable, or what would be really cool to have.

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Tue Jan 10, 2012 9:26 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
FelipeFS wrote:
For those ones who are curious about the game source-code and the syntax, here is the document
Ha, looks like an LL(1) parser :)

Easy to code and very good for debugging. Also, in general very fast.

Can you also handle nested structures, such as finding matching parentheses in an expression?
(Probably you can, but it depends a bit on how you actually match a rule.)

You may want to consider reducing the amount of clutter, eg in
Code:
 [SPRITE] SSpriteName;
 [SPRITEBEGIN] SSpriteName;
one of the lines seems redundant to me. There are a few more such cases.
Dropping duplicate text would make writing code in your language more pleasant.

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


Top
 Profile  
 
PostPosted: Wed Jan 11, 2012 4:02 am 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Alberth wrote:
Ha, looks like an LL(1) parser :)

I didn't know "LL(1)" parser, or its variants, but i guess my CodeScanner is one. =)

Alberth wrote:
You may want to consider reducing the amount of clutter, eg in
Code:
 [SPRITE] SSpriteName;
 [SPRITEBEGIN] SSpriteName;
one of the lines seems redundant to me. There are a few more such cases.
Dropping duplicate text would make writing code in your language more pleasant.


Yes, I understand what you mean. The script language is very redundant, for now. I made the language this way to avoid at maximum errors while I'm not yet secure. But before finish, I intend to modify it, removing the redundant parts of scanning. Like you said before, it is very good for debugging.

EDIT/UPDATE:
Now, is possible to manipulate the room/maps selecting multiples tiles - direct link:
- Image 01
- Image 02

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


Top
 Profile  
 
PostPosted: Wed Jan 11, 2012 9:56 am 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1553
Location: burrowed
sweet :)

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Thu Jan 12, 2012 6:00 am 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
People, I have something to share/ask your opinion.

Well, the maps, as you can see in the code I poste above, are stored in the game project source-code(by the way, the *.dat files generated by my IDE are written in the same language, but encrypted, wich allows store maps, and informations about sprites, sounds... in the data file), and obviously, the project source-code is written in text mode, not binary mode. Because of that, a map with 256x256 tiles has 256 KB of size!... do you think it is too much?

Other think:
Since *.dat files are text mode(and encrypted), I will not be able to store images(bitmaps, png...), sounds, and fonts in the *.dat file.
At first those *.dat files gonna be like standards *.res files( See the post I created about this ), but now there will have to be *.dat files and *.res.
- *.dat - Contains script codes: Information about maps, sprites, sounds, images.
- *.res - Contains images, texts files, sounds, fonts.

- See that *.dat contains only information about sprites, don't contains the bitmaps of the sprites. So, the information about the sprite in the *.dat will point to the *.res file, where the bitmap is stored.

This is the solution I found for the problem... create two kinds of storage files(*.dat and*.res).

You people must be tired of my long posts...

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


Top
 Profile  
 
PostPosted: Thu Jan 12, 2012 12:33 pm 
King Code Monkey
User avatar

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11182
Location: Abingdon, MD
FelipeFS wrote:
This is the solution I found for the problem... create two kinds of storage files(*.dat and*.res).

Which makes sense. Data files shouldn't have graphics embedded in them. That would make reusing graphics problematic in that you're wasting space. Not that space should be a problem, but it's just bad practice.

_________________
Bored? Head on over to my blog and see what I'm up to.

Microsoft XNA MVP


Top
 Profile  
 
PostPosted: Thu Jan 12, 2012 6:25 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 277
Location: Here (where else?)
Compress the text-file prior to encrypting

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


Top
 Profile  
 
PostPosted: Fri Jan 13, 2012 5:20 am 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
I have a new goal. The IDE works in the (I) mode:
Image

But, I realized that the (II) mode is better to make the project organized. The problem is that I will have to change a lot of things... I'm very tired... :x

Note: The image of the (II) mode was made on paint.

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


Last edited by FelipeFS on Fri Jan 13, 2012 8:58 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Jan 13, 2012 8:32 am 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6719
Location: Oxford, Englandshire
I may be reading it wrong, but won't method II will result in duplication of assets?

I imagine you'll have some assets that appear across most if not all your levels. The player sprite, images for on-screen controls, the main font, common sounds, etc, etc.

If these assets are wrapped up in a *.dat file for each level, won't you have multiple copies of the common objects?

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
PostPosted: Fri Jan 13, 2012 8:58 am 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Codehead wrote:
I may be reading it wrong, but won't method II will result in duplication of assets?

I imagine you'll have some assets that appear across most if not all your levels. The player sprite, images for on-screen controls, the main font, common sounds, etc, etc.

If these assets are wrapped up in a *.dat file for each level, won't you have multiple copies of the common objects?


No. The game developer would place different objects in different *.dat files. For example, The game developer could create a DataFile where there gonna be the rooms(maps). In other DataFile, there gonna be Sprites, Fonts, etc. So, no matter if the player is in the "MAP X" that is in DataFile01, the sprites will be loaded from DataFile02.

Anyway, the method (II) and (I) generates the same kind of final executable. The point is how the IDE will be designed to make that.

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


Top
 Profile  
 
PostPosted: Fri Jan 13, 2012 11:13 am 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6719
Location: Oxford, Englandshire
Ah, I see. That makes more sense.

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
PostPosted: Sat Jan 14, 2012 5:44 am 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Alberth wrote:
Compress the text-file prior to encrypting

I almost forgot about compression! Encrypting and Dencrypting is already solved. :)
___________________________________________________________________________

So... After much thought trying to find a solution to make a better interface, here's the result I have elaborated(it is just an illustration... yet):

Image
The idea was to separate what is part of the source-code(and final executable) from another files(data files).

Opinions are welcome! Thank you all!

UPDATE:
The program is already working the way you see above! Now, I'm working to make possible the maps load the tilesets from the resource files.

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


Top
 Profile  
 
PostPosted: Mon Feb 06, 2012 8:07 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
I'm developing a blog for my project. It is just the layout for now:

http://pixeldeveloper.blogspot.com/

BTW, I have started learn HTML5 to make this blog, it is pretty cool! I hated ​​web programming(my apologies for all web developers :lol ) but, HTML5 looks promising and is very powerful.

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


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 3:54 am 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Scorpion wrote:
Get over here, old topic!

Well, I'm now working with the Game Engine, not the IDE. I'm progressing slowly with the IDE, not because of programming issues, but because of concept issues.

Well, like I said, I'm working with the GE, and I will make a simple game with it! Not using the IDE. Just to see if everything will work fine.

Just a simple code of the Game Engine - so far:
Spoiler: show
Code:
{$MODE OBJFPC}
unit MEGameEngine;

{-----------------------------------------------------------------}
{                                                                 }
{                Machina Engine - Game Engine Unit                }
{                                                                 }
{-----------------------------------------------------------------}

interface

uses Windows, SysUtils, Variants, Classes, Contnrs, Graphics, Math;

type
  TBaseMessage = class
  public
    FMessage : Cardinal;
    FParamL : Integer;
    FParamR : Integer;
    FParamResult : Integer;
  end;

  TImgType = (itNone, itPNG, itBMP);

  TBasePicture = class(TObject)
  public
    FPicture : TGraphic;
    FImageType : TImgType;

    constructor Create;
    destructor Destroy;
  end;

  TBaseRoom = class(TObject)
  public
    FName : String;
    FWidth : Integer;
    FHeight : Integer;
    FRoomTiled : Boolean;
    FMajorGrid : Boolean;
    FMajorGridWidth : Integer;
    FMajorGridHeight : Integer;
    FTileSetGrid : Boolean;
    FTileWidth : Integer;
    FTileHeight : Integer;

    FObjectList : TObjectList;

    constructor Create;
    destructor Destroy;
  end;

  TBaseSprite = class(TObject)
  public

    constructor Create;
    destructor Destroy;
  end;

  TBaseClass = class(TObject)
  private
    FName : String;
    FPosX, FPosY, FPosZ : Extended;
    FSprite : TBaseSprite;
    FSpriteIndex : Integer;
    FSpriteSpeed : Extended;

    FDirection : Extended;
    FSpeed : Extended;
    FSpeedH : Extended;
    FSpeedV : Extended;
    FVisible : Boolean;
    FRoomOwner : TBaseRoom;

    destructor Destroy;
    constructor Create;
  end;

  TApplicationGame = class(TObject)
  public
    FMainRoom : TBaseRoom;
    FRoom : TBaseRoom;

    procedure ProcessMessages;

    constructor Create;
    destructor Destroy;
  end;

var
  FObjList : TObjectList;

implementation

{ Implementation }

procedure SetFPosition(BObject : TBaseClass; BPosX, BPosY : Extended);
begin
  if (BObject <> nil) then
  begin
    BObject.FPosX := BPosX;
    BObject.FPosY := BPosY;
  end;
end;

procedure SetFPositionEx(BObject : TBaseClass; BPosX, BPosY, BPosZ : Extended);
begin
  if (BObject <> nil) then
  begin
    BObject.FPosX := BPosX;
    BObject.FPosY := BPosY;
    BObject.FPosZ := BPosZ;
  end;
end;

procedure SetFDirection(BObject : TBaseClass; BDirection : Extended);
begin
  if (BObject <> nil) then
  begin
    BObject.FDirection := BDirection;
  end;
end;

procedure SetFSpeed(BObject : TBaseClass; BSpeed : Extended);
begin
  if (BObject <> nil) then
  begin
    BObject.FSpeed := BSpeed;
  end;
end;

procedure SetFSprite(BObject : TBaseClass; BSprite : TBaseSprite; BSpriteSpeed : Extended; BSpriteIndex : Integer);
begin
  if ((BObject <> nil) and (BSprite <> nil)) then
  begin
    BObject.FSprite := BSprite;
    BObject.FSpriteSpeed := BSpriteSpeed;
    BObject.FSpriteIndex := BSpriteIndex;
  end;
end;

procedure DestroyFObject(BObject : TBaseClass);
begin
  if (BObject <> nil) then
  begin
    FreeAndNil(BObject);
  end;
end;

procedure SetFRoomOwner(BObject : TBaseClass; BRoom : TBaseRoom);
begin
  if ((BObject <> nil) and (BRoom <> nil)) then
  begin
    BObject.FRoomOwner := BRoom;
  end;
end;

{ Implementation - TBasePicture }

constructor TBasePicture.Create;
begin

end;

destructor TBasePicture.Destroy;
begin

end;

{ Implementation - TBaseRoom }

constructor TBaseRoom.Create;
begin
  inherited Create;

end;

destructor TBaseRoom.Destroy;
begin

  inherited Destroy;
end;

{ Implementation - TBaseSprite }

constructor TBaseSprite.Create;
begin
  inherited Create;

end;

destructor TBaseSprite.Destroy;
begin

  inherited Destroy;
end;

{ Implementation - TBaseClass }

constructor TBaseClass.Create;
begin
  inherited Create;

end;

destructor TBaseClass.Destroy;
begin

  inherited Destroy;
end;

{ Implementation - TApplicationGame }

procedure TApplicationGame.ProcessMessages;
begin

end;

constructor TApplicationGame.Create;
begin

end;

destructor TApplicationGame.Destroy;
begin

end;

end.

:)

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


Top
 Profile  
 
PostPosted: Mon Feb 27, 2012 8:57 pm 
Harmlessness does no harm
User avatar

Joined: Tue Sep 14, 2004 8:37 pm
Posts: 3810
Location: Ferriday, LA, US
FelipeFS wrote:
Scorpion wrote:
Get over here, old topic!

Haha, took me a second to figure that one out. :) Well played!

_________________
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  
 
PostPosted: Tue Mar 13, 2012 8:19 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Like I said, my only problem is with concepts. but I'm bringing here an important feature: A resource manager. Posts ago, I said that my Engine will use *.dat files(storage of informations, pointing to the resource with files like bitmaps and sounds) and the *.res files.

Data files are already done. And the code for manage resource files is working. Here is a program I did using the library of resource files:

[Screenshot 01]
[Screenshot 02]

The resource manager can store Text, WAV files, Bitmaps and PNG.

Now the map editor of my IDE will be able to load the tiles!!! :thumbs

NOTE: It is not the conventional .res file of the Windows.

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


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 5:19 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Hey guys, how are you doing???
Well, I'm working directly with the Game Engine, for now, leaving the IDE alone, for a while.

I have already the main loop, which can work on different options: [Good article about MAIN LOOP]

And, I've made a console application which loads a data file containing a room/map with 1 object inside. This is the output of the console:
Image

You can see the data file here:
Spoiler: show
Code:
[DATAFILE] DFScenarios001;

[ROOMDATA]

  [ROOM] RRoomName001;
  [ROOMBEGIN] RRoomName001;
    [FIELD] FGridWidth := '32';
    [FIELD] FGridHeight := '32';
    [FIELD] FRoomTiled := 'True';
    [FIELD] FWidth := '8';
    [FIELD] FHeight := '8';
    [FIELD] FLayer [ 1 ] := { 2.2,2.2,1.1,1.1,0.0 };

    [FIELD] FLayerTileSet [ 1 ] := 'LTSGrassLand';
   
    [LISTBEGIN] FObjectList;
    [OBJECT] TBaseObject : 'FMainCharacter';
    [OBJECTBEGIN] TBaseObject;
      [FIELD] FName := 'FMainCharacter';
      [FIELD] FPosX := '20';
      [FIELD] FPosY := '26';
      [FIELD] FPosZ := '0';
      [FIELD] FSpriteName : 'SName';
      [FIELD] FSpriteIndex : '1';
      [FIELD] FSpriteSpeed : '0.6'; // Speed of the sprite's framerate;
    [OBJECTEND] TBaseObject : 'FMainCharacter';

    [LISTEND] FObjectList;

  [ROOMEND] RRoomName001;

[ROOMDATAEND]

[DATAFILEEND]


Also, the variables of an object are also loaded, you can see that in the "[FIELD] FPosX := 20;".

About the physics, I'm studying Bullet Physics Library, and because of that, I'm putting in the base object class a lot of the variables that are found in Blender objects and related to physics. :rock

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


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 5:46 pm 
Grand Optimizer
User avatar

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

_________________
"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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 76 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
Powered by phpBB® Forum Software © phpBB Group