2D RPG Engine

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Re: Simple 2D RPG Engine

Postby Falco Girgis on Tue May 14, 2013 9:46 pm

Light-Dark wrote:Basically it's doing a bounding box collision detection between the player and the specified tile, if the player is colliding with the lower tile it shifts the depth value down in lua, however if the player is colliding with the upper tile it shifts the depth value up. To keep from creating unnecessary issues I have the players x and y 'snapped' to multiples of 32x32 so the player won't be colliding with both at the same time. This system serves as a place holder for the moment.
Yeah, that's basically how we're going to handle it. I didn't even realize the player was being snapped to a grid in the video, since motion looked so smooth.

Chrono Trigger's engine calls these "z-transitional" tiles.

Light-Dark wrote:And this is how camera zooming/rotating is currently handled:
void GameSystem::Camera_Transform(const float scale,const float rotation)
{
UniformScaleVal = scale;
camera.w = SCREEN_WIDTH * (1/scale);
camera.h = SCREEN_HEIGHT * (1/scale);
glScalef(scale,scale,1);

glTranslatef(camera.w/2,camera.h/2,0);
glRotatef(rotation,0,0,1);
glTranslatef(-camera.w/2,-camera.h/2,0);

}
You have the right basic idea (obviously, or it wouldn't be working as well as it is now). The order of operations is:
1) translate to the center of the screen, so that every transform is now relative to this point.
2) apply the camera's uniform zoom/scale
3) apply the camera's rotation
4) translate back to the camera's world-space coordinates

Actual algorithm used in ES:
Code: Select all
void CameraSystem::PushTransform(void) {
   gyMatPush();
   gyMatTranslate(_scrWidth/2.0f, _scrHeight/2.0f, 0.0f);
   gyMatScale(transform._scale.x, transform._scale.y, 1.0f);
   gyMatRotateZ(transform._orientZ);
   gyMatTranslate(-transform._pos.x, -transform._pos.y, 0.0f);
}
Cheers.
"So what happens if the Elysian Shadows Kickstarter fails?"
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
 
Posts: 10693
Joined: Thu May 20, 2004 3:04 pm
Location: Studio Vorbis, AL

Re: Simple 2D RPG Engine

Postby Light-Dark on Sun May 19, 2013 1:32 am

Falco Girgis wrote:You have the right basic idea (obviously, or it wouldn't be working as well as it is now).


Good to know I'm on the right track :)!

Anyways, I've recently begun learning to do some pixel art so I can make placeholder or possibly real assets for the game itself and this is what I have to show for it:
Placeholder.png
Artwork
(112.96 KiB) Not downloaded yet


It's pretty meh right? I'm not that great of an artist :lol:. You'll also notice I've changed the layout around on the editor and added a new depth settings widget for controlling the newfangled depth/elevation system annnd I also changed the style of the UI because why not!
<tpw_rules> LightDark: java is a consequence of inverse moore's law: every 18 months, the average program will be twice as slow. therefore, computers always run at the same percevied speed. java's invention was a monumental step

Image
User avatar
Light-Dark
Dreamcast Developer
Dreamcast Developer
 
Posts: 317
Joined: Sun Mar 13, 2011 8:57 pm
Location: Canada

Re: Simple 2D RPG Engine

Postby Falco Girgis on Sun May 19, 2013 11:56 am

How does the depth slider work? Do you have to make a selection first, and it is applied to the tile(s) within the selection?
"So what happens if the Elysian Shadows Kickstarter fails?"
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
 
Posts: 10693
Joined: Thu May 20, 2004 3:04 pm
Location: Studio Vorbis, AL

Re: Simple 2D RPG Engine

Postby Light-Dark on Sun May 19, 2013 12:57 pm

Falco Girgis wrote:How does the depth slider work? Do you have to make a selection first, and it is applied to the tile(s) within the selection?


The depth is applied when you lay a tile with the depth flag turned on(otherwise it's automatically set to 0), the depth slider also controls which elevation of the collision layer you are dealing with/viewing.
<tpw_rules> LightDark: java is a consequence of inverse moore's law: every 18 months, the average program will be twice as slow. therefore, computers always run at the same percevied speed. java's invention was a monumental step

Image
User avatar
Light-Dark
Dreamcast Developer
Dreamcast Developer
 
Posts: 317
Joined: Sun Mar 13, 2011 8:57 pm
Location: Canada

Re: Simple 2D RPG Engine

Postby Falco Girgis on Mon May 20, 2013 10:05 am

Aaaaah, I gotcha. Nice!

Thought of another question. Is only one of your layers elevatable? If they are both elevatable, does one always have to be above the other one, or can layer 1 technically be levated above layer 2?
"So what happens if the Elysian Shadows Kickstarter fails?"
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
 
Posts: 10693
Joined: Thu May 20, 2004 3:04 pm
Location: Studio Vorbis, AL

Re: Simple 2D RPG Engine

Postby Light-Dark on Mon May 20, 2013 11:34 am

Falco Girgis wrote:Aaaaah, I gotcha. Nice!

Thought of another question. Is only one of your layers elevatable? If they are both elevatable, does one always have to be above the other one, or can layer 1 technically be levated above layer 2?


I spent a bit testing that out and it appears that layer 2 will always render above the first layer despite elevation levels.


Also, I thought I should show some footage of the Dreamcast version in action. It's kinda outdated now as I'm still working on getting/making a BBA or coders cable but consider this confirmation that it is indeed happening!

<tpw_rules> LightDark: java is a consequence of inverse moore's law: every 18 months, the average program will be twice as slow. therefore, computers always run at the same percevied speed. java's invention was a monumental step

Image
User avatar
Light-Dark
Dreamcast Developer
Dreamcast Developer
 
Posts: 317
Joined: Sun Mar 13, 2011 8:57 pm
Location: Canada

Re: Simple 2D RPG Engine

Postby bbguimaraes on Mon May 20, 2013 1:10 pm

I smell an instant promotion...
User avatar
bbguimaraes
Chaos Rift Junior
Chaos Rift Junior
 
Posts: 324
Joined: Wed Apr 11, 2012 5:34 pm
Location: Brazil

Re: Simple 2D RPG Engine

Postby Light-Dark on Mon May 20, 2013 11:27 pm

bbguimaraes wrote:I smell an instant promotion...


I guess your prediction was right :lol:, I've always wanted to have a game I made run on a console and now that dream is going to be realized!
<tpw_rules> LightDark: java is a consequence of inverse moore's law: every 18 months, the average program will be twice as slow. therefore, computers always run at the same percevied speed. java's invention was a monumental step

Image
User avatar
Light-Dark
Dreamcast Developer
Dreamcast Developer
 
Posts: 317
Joined: Sun Mar 13, 2011 8:57 pm
Location: Canada

Re: Simple 2D RPG Engine

Postby Light-Dark on Fri May 24, 2013 3:31 pm

Just a quick update everybody, got a DC SD card adapter ordered! Expect some more Dreamcast in future updates/videos!

EDIT:

Adding on to this update, I updated KOS and the Dc tool-chain so now everything runs on KOS 2.0.0.
<tpw_rules> LightDark: java is a consequence of inverse moore's law: every 18 months, the average program will be twice as slow. therefore, computers always run at the same percevied speed. java's invention was a monumental step

Image
User avatar
Light-Dark
Dreamcast Developer
Dreamcast Developer
 
Posts: 317
Joined: Sun Mar 13, 2011 8:57 pm
Location: Canada

Re: Simple 2D RPG Engine

Postby Light-Dark on Thu Jun 06, 2013 4:39 pm

I'm rewriting it again. Now you might be wondering why I'm deciding to rewrite it in the middle of a rewrite? Well that's because of a few design issues and the annoyance of switching between two different builds of the same thing. To combat these issues I've been working on a library written in C that abstracts the engine away from the PC and Dreamcast, so far I've got the PC version up and running and I'm working on the DC version now. I'm currently working on the Matrix transformations for the Dreamcast and I'm hoping to have basic functionality for both versions of the library working soon. All of this shouldn't be to big of a delay, this is something I feel that overall will be more beneficial to the project. More updates later!
<tpw_rules> LightDark: java is a consequence of inverse moore's law: every 18 months, the average program will be twice as slow. therefore, computers always run at the same percevied speed. java's invention was a monumental step

Image
User avatar
Light-Dark
Dreamcast Developer
Dreamcast Developer
 
Posts: 317
Joined: Sun Mar 13, 2011 8:57 pm
Location: Canada

Re: Simple 2D RPG Engine

Postby bbguimaraes on Thu Jun 06, 2013 4:55 pm

Light-Dark wrote:Now you might be wondering why I'm deciding to rewrite it in the middle of a rewrite?

Everybody knows time passes more slowly on the inner rewrites.
User avatar
bbguimaraes
Chaos Rift Junior
Chaos Rift Junior
 
Posts: 324
Joined: Wed Apr 11, 2012 5:34 pm
Location: Brazil

Re: Simple 2D RPG Engine

Postby Light-Dark on Thu Jun 20, 2013 2:25 pm



Got things running on the Dreamcast nicely now as shown in the video ( apologies for the camera-pointed-at-tv method of recording, I long for the days when I had my capture card). I now have a Dreamcast SD Card adapter and that has made testing a lot easier and reliable ( NullDC does not seem to like hardware sprites ).
<tpw_rules> LightDark: java is a consequence of inverse moore's law: every 18 months, the average program will be twice as slow. therefore, computers always run at the same percevied speed. java's invention was a monumental step

Image
User avatar
Light-Dark
Dreamcast Developer
Dreamcast Developer
 
Posts: 317
Joined: Sun Mar 13, 2011 8:57 pm
Location: Canada

Re: Simple 2D RPG Engine

Postby Light-Dark on Fri Dec 20, 2013 4:23 am



Progress Made on top of the rewrite:
- Totally revamped Character system
- Revamped animation system ( way more flexible for character animations)
- New Dialogue/Textbox System ( allows for complex branching conversations)
- Revamped log system ( looks prettier! )
- Optimized rendering routines ( Noticeable performance gain, especially on the dreamcast, runs at 60fps)
<tpw_rules> LightDark: java is a consequence of inverse moore's law: every 18 months, the average program will be twice as slow. therefore, computers always run at the same percevied speed. java's invention was a monumental step

Image
User avatar
Light-Dark
Dreamcast Developer
Dreamcast Developer
 
Posts: 317
Joined: Sun Mar 13, 2011 8:57 pm
Location: Canada

Re: Simple 2D RPG Engine

Postby dandymcgee on Fri Dec 20, 2013 4:29 pm

Wow, didn't know you were still working on this. Nice progress, you should post updates here more often!
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: Simple 2D RPG Engine

Postby Falco Girgis on Fri Dec 20, 2013 6:20 pm

Glad you're still fighting the good fight! Looks great.
"So what happens if the Elysian Shadows Kickstarter fails?"
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
 
Posts: 10693
Joined: Thu May 20, 2004 3:04 pm
Location: Studio Vorbis, AL

PreviousNext

Return to Game Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron