GPWiki.org
GPWiki.org
It is currently Thu Jun 20, 2013 9:23 am

All times are UTC




Post new topic Reply to topic  [ 76 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
PostPosted: Fri Jun 15, 2012 10:04 am 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1567
Location: burrowed
FelipeFS wrote:
The files need to be extracted in "C:\", I forgot to implement to make the game search the data and resource files in another directory.


A good way to do this is start the path relative to the executable, and it would be very much appreciated ;)

FelipeFS wrote:
And the game is a bit slow, because the Shark(the enemy) make a math to get the angle between itself and the fish every time. Such math sould be done at a time interval, but the TimerEvent is being implemented yet.


I wonder about that. Math as simple as this shouldn't slow the game down. Have you tried to not output your debug data through a console window?

Also you might consider starting your application either on the last closed position or in the center of the screen. It always spawned in the top left corner, halfway behind my taskbar. by the time i dragged it away i've been eaten :D

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Fri Jun 15, 2012 12:11 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Yeah, you are right, I just changed 3 ways to understand why so slow.

It is because of the function that rotates the bitmap(sprite), this function is very slow. I discovered when I put to draw just dots instead of the sprites. Plus, even if the sprite is not rotated(like the sharks), the function is called(with 0 as angle parameter). The backwardness is increased when there is a lot of objects in the map.

I can't create different alternatives such call the function while the object is not rotated, because the game speed will be changed while rotating. Or don't call the rotate function for a particular sprite(like the sharks), because the game engine don't know which sprite the developer wants to rotate.

BUUUUT, use a graphic engine such OpenGL will solve the problem... And give me the problem to understand how to draw 2D graphics in OpenGL(I tried a lot of times).

_________________
"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 Jun 15, 2012 12:16 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
About the directory, I have to make a implementation more complex than that, since the directory of the resource-file is taken from the data-file.

But it will be changed soon. =)

_________________
"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 Jun 15, 2012 1:30 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1567
Location: burrowed
FelipeFS wrote:
BUUUUT, use a graphic engine such OpenGL will solve the problem... And give me the problem to understand how to draw 2D graphics in OpenGL(I tried a lot of times).


Basically you dont draw in 2D, you just change the camera matrix to an orthographic style looking along an axis, so objects near to the camera have the same size as far objects, but they are actually in 3d space.

Most basic GL tutorials will walk you through to set up an orthographic camera.

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Fri Jun 15, 2012 2:18 pm 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6755
Location: Oxford, Englandshire
weezl wrote:
Basically you dont draw in 2D, you just change the camera matrix to an orthographic style looking along an axis, so objects near to the camera have the same size as far objects, but they are actually in 3d space.


There's one on the Wiki: http://content.gpwiki.org/index.php/Ope ... _and_Alpha

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
PostPosted: Tue Jun 19, 2012 1:44 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Hello, warriors from Valhalla, here is what I got so far with OpenGL:
Image

The texture should be the fish and the sharks, I still don't know where is the problem to display it right. Probably it is my OpenGL code, or maybe it is the pixel data that is not being passed right to make the texture. I think that it is my OpenGL code, because even the data being passed wrong, the textures displayed should be different from each other(between the fish and shark textures). And that is not what is happening(as you can see, all wrong textures are equal).

_________________
"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: Tue Jun 19, 2012 9:14 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Yeaaaah, it is working!

Download link: [Link]

you can extract anywhere now, I have implemented already the code to search which is the application folder and where are the files. So, the files .res and .dat must be in the same directory of the game.

The game file is big(13MB, I think that this is the average of the minimal size, because it came with the game engine inside- of course- but also can be some bitmap images that could be freed from memory after the texture be loaded).

Also, I think that the texture of the shark is not being created, and the texture of the fish is being called instead. I still haven't checked why.

_________________
"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 Jun 22, 2012 12:43 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
The boring when you accomplish a lot of things at once is that you get lost about what to do next. :lol

_________________
"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 Jun 22, 2012 1:39 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1567
Location: burrowed
FelipeFS wrote:
The boring when you accomplish a lot of things at once is that you get lost about what to do next. :lol


i agree. I often feel like that "oh thats so cool...well what now? .... .... .... ... ..." and then heavy procrastination occurs :D

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Sat Jun 23, 2012 6:21 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Just acomplished part of the "room tiling implementation" for 2D orthographic projection.
I have four 2D projections to accomplish:
  • Orthographic;
  • Isometric;
  • Dimetric; // little-known
  • Trimetric; // little-known

I'm excited to start implementing the dimetric and trimetric projections. Few games use these projections(as far I know: SimCity, Fallout, and a PacMan)

Image

:yeah

_________________
"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: Sat Jun 23, 2012 7:06 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 283
Location: Here (where else?)
Transport Tycoon Deluxe, OpenTTD, RollerCoaster Tycoon, FreeRCT, Theme hospital, CTH are all dimetric.
Reason is that the 2:1 ratio is so nice so computing coordinates.

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


Top
 Profile  
 
PostPosted: Sat Aug 18, 2012 7:14 pm 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
A lot of progress have being made. I'm even creating a platform game(I wish to start a campaign on Kickstarter, but they are not allowing foreigners for now), but the game engine is not fully completed, still need:
[*]Time-driven: if the programmer want to create an "Alarm", like in Game Maker.
[*]Mouse input;
[*]Improve the cameras;
[*]Audio - this is the last thing I will implement;


and...

[*]I'm working again on the game engine IDE, it's very boring and slow to create maps just editing a text file.

_________________
"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: Sat Aug 18, 2012 8:05 pm 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6755
Location: Oxford, Englandshire
FelipeFS wrote:
[*]I'm working again on the game engine IDE, it's very boring and slow to create maps just editing a text file.


This bit is very helpful, but can eat up a lot of time.

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
PostPosted: Sat Aug 18, 2012 8:10 pm 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 283
Location: Here (where else?)
Can't you see the editor as a game, and program it in your own framework?

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


Top
 Profile  
 
PostPosted: Sat Aug 25, 2012 9:39 am 
Source Code Swashbuckler
User avatar

Joined: Wed Nov 09, 2011 3:58 am
Posts: 199
Location: Brazil
Alberth wrote:
Can't you see the editor as a game, and program it in your own framework?

Now I understood what you meant - edit the room at run-time? yes, it is possible, but not so intuitive.

Well, guys... here is the result so far:

Image

_________________
"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: Sat Aug 25, 2012 11:08 am 
Bytewise

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 283
Location: Here (where else?)
Looking good!

FelipeFS wrote:
Alberth wrote:
Can't you see the editor as a game, and program it in your own framework?

Now I understood what you meant - edit the room at run-time? yes, it is possible, but not so intuitive.
No it's not what I mean (I think).


Forget completely that you are making Machina Engine for a moment.


I was/am suggesting to write a new and exciting game, namely "make a map".
Objective: Make a nice map by picking and placing objects from a repository, and place them in a grid.
Bonus points for using all objects and for filling the entire grid.
Higher levels are bigger and have more kinds of objects.
You can save the game halfway, to continue later.
<insert more game promotion blurb here>

Sounds like a fun game, doesn't it? :D


So this is the game you want to write.
Now we need something for implementing the game.

Option 1: Plain programming language? nah, too much work.
Option 2: Use a library, like SDL or Allegro? nah, still too much work.
Option 3: Some game engine? Oh, I know one, namely "Machina Engine"

The trick to understanding and not go insane is to let go of the idea that 'making a map' is part of the Machina project.

Map-making is not part of the Machina project.
Map-making is not part of the Machina project.
(let it sink in for a while)

Well, it is, but let's call it Machina-core and Machina-applications. The 'core' is everything but map making. 'applications' is map-making.
In other words, map-making can be seen as a layer on top of that core (or aside of it, if you like).

It's like Notepad in Windows. It comes as part of the Windows OS (at least it used to). You won't find a Windows machine without it.
However, which one is true:
- is Notepad a part of the OS, or
- is Notepad something on top of the OS ?
(I hope you agree the second option is true).
Both views are defendable, it's just a matter of where you think the OS ends, and where applications begin.

In Machina you have the same. You have functionality, and you can see making a map as part of that functionality. However, you can also see it as an application on top of Machine core functions.
(Map making is not a core functionality I think, eg the game of making a map does not need a pre-made map as input.)

I'd say a map maker as a very nice demo project for the Machina (core) engine.

_________________
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  [ 76 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] 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:  
Powered by phpBB® Forum Software © phpBB Group