Page 18 of 19

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Fri Jun 03, 2011 11:29 am
by LeonBlade
Well, each tile is just represented as one value, for example 33 for an ID.
The render function calculates different SDL_Rects for the source rectangle and Vector2s for position.
I was thinking making an array of SDL_Rects and Vector2s and when the map loads it would calculate them once and pass through all the rects and vectors at render time and not have to worry about re-calculating. One thing, however, is that the Toolkit would need to recheck every time a new auto-tile is placed.
Each tile might consist of just 1 rect or possibly 2, 3 or 4 depending on what it is.

Do you think this would be the appropriate approach?

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Fri Jun 03, 2011 7:55 pm
by MrDeathNote
LeonBlade wrote:Well, each tile is just represented as one value, for example 33 for an ID.
The render function calculates different SDL_Rects for the source rectangle and Vector2s for position.
I was thinking making an array of SDL_Rects and Vector2s and when the map loads it would calculate them once and pass through all the rects and vectors at render time and not have to worry about re-calculating. One thing, however, is that the Toolkit would need to recheck every time a new auto-tile is placed.
Each tile might consist of just 1 rect or possibly 2, 3 or 4 depending on what it is.

Do you think this would be the appropriate approach?
That's very appropriate, isn't that the entire point of having a toolkit? It's static content, if you calculate it once, you don't ever want to do that again. The idea is that you calculate your autotiles in the toolkit(which helps level development). Then you load that static content at runtime. The engine should never have to worry about caluculating that. The more you can abstract from the engine at runtime, the better.

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Sat Jun 04, 2011 12:47 am
by LeonBlade
MrDeathNote wrote:That's very appropriate, isn't that the entire point of having a toolkit? It's static content, if you calculate it once, you don't ever want to do that again. The idea is that you calculate your autotiles in the toolkit(which helps level development). Then you load that static content at runtime. The engine should never have to worry about caluculating that. The more you can abstract from the engine at runtime, the better.
Thank you, I'm glad to see I'm on the right track then! ;)
Very much appreciated, once I get some time I should optimize all of this.

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Sat Aug 13, 2011 4:36 am
by xx6heartless6xx
Hey Leon, your level editor looks really cool and I want to make mine like it. I was wondering how you display your level on the screen in Qt. I have my layout like this in the image and want to display the level in the large white area in the center of my program.
level.png
level.png (65.24 KiB) Viewed 3216 times
My level editor also reads from a .map file where each tile has an id and it reads from the .map file and shows the tile it should. I'll post code if I'm not being clear enough. Thanks.

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Sat Aug 13, 2011 12:06 pm
by LeonBlade
xx6heartless6xx wrote:Hey Leon, your level editor looks really cool and I want to make mine like it. I was wondering how you display your level on the screen in Qt. I have my layout like this in the image and want to display the level in the large white area in the center of my program.
level.png
My level editor also reads from a .map file where each tile has an id and it reads from the .map file and shows the tile it should. I'll post code if I'm not being clear enough. Thanks.
What are you rendering your map with, or should I say what do you want to render it with? I use OpenGL, I assume you're using that?

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Sat Aug 13, 2011 3:18 pm
by xx6heartless6xx
LeonBlade wrote:
xx6heartless6xx wrote:Hey Leon, your level editor looks really cool and I want to make mine like it. I was wondering how you display your level on the screen in Qt. I have my layout like this in the image and want to display the level in the large white area in the center of my program.
level.png
My level editor also reads from a .map file where each tile has an id and it reads from the .map file and shows the tile it should. I'll post code if I'm not being clear enough. Thanks.
What are you rendering your map with, or should I say what do you want to render it with? I use OpenGL, I assume you're using that?
I used to use SDL for rendering before I moved over to Qt but now I want to use Qt's functions. I never really used OpenGl.

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Sun Aug 14, 2011 4:11 am
by LeonBlade
xx6heartless6xx wrote:
LeonBlade wrote:
xx6heartless6xx wrote:Hey Leon, your level editor looks really cool and I want to make mine like it. I was wondering how you display your level on the screen in Qt. I have my layout like this in the image and want to display the level in the large white area in the center of my program.
level.png
My level editor also reads from a .map file where each tile has an id and it reads from the .map file and shows the tile it should. I'll post code if I'm not being clear enough. Thanks.
What are you rendering your map with, or should I say what do you want to render it with? I use OpenGL, I assume you're using that?
I used to use SDL for rendering before I moved over to Qt but now I want to use Qt's functions. I never really used OpenGl.
I suggest looking into learning OpenGL before anything, it's not as complicated as you first might think, trust me. Once you're confident, try learning about QGLWidgets in QT and also learning about the sharedWidget property in the QGLWidget constructor to pass things back and forth between widgets so you can make the map editor work properly without loads of run time errors with white texture and loads of other problems.

If you need to ask any questions, feel free to and I'll try to help the best I can. I still need to remake my Toolkit again as I keep striving towards a very open OO design and I keep starting over not feeling satisfied.

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Sun Aug 14, 2011 5:35 am
by xx6heartless6xx
LeonBlade wrote:
xx6heartless6xx wrote:
LeonBlade wrote:
xx6heartless6xx wrote:Hey Leon, your level editor looks really cool and I want to make mine like it. I was wondering how you display your level on the screen in Qt. I have my layout like this in the image and want to display the level in the large white area in the center of my program.
level.png
My level editor also reads from a .map file where each tile has an id and it reads from the .map file and shows the tile it should. I'll post code if I'm not being clear enough. Thanks.
What are you rendering your map with, or should I say what do you want to render it with? I use OpenGL, I assume you're using that?
I used to use SDL for rendering before I moved over to Qt but now I want to use Qt's functions. I never really used OpenGl.
I suggest looking into learning OpenGL before anything, it's not as complicated as you first might think, trust me. Once you're confident, try learning about QGLWidgets in QT and also learning about the sharedWidget property in the QGLWidget constructor to pass things back and forth between widgets so you can make the map editor work properly without loads of run time errors with white texture and loads of other problems.

If you need to ask any questions, feel free to and I'll try to help the best I can. I still need to remake my Toolkit again as I keep striving towards a very open OO design and I keep starting over not feeling satisfied.
Rendering with Opengl in Qt then is simple? Do you need to change any of your Opengl code to work in Qt?

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Wed Aug 17, 2011 2:30 am
by LeonBlade
xx6heartless6xx wrote:
LeonBlade wrote:
xx6heartless6xx wrote:
LeonBlade wrote:
xx6heartless6xx wrote:Hey Leon, your level editor looks really cool and I want to make mine like it. I was wondering how you display your level on the screen in Qt. I have my layout like this in the image and want to display the level in the large white area in the center of my program.
level.png
My level editor also reads from a .map file where each tile has an id and it reads from the .map file and shows the tile it should. I'll post code if I'm not being clear enough. Thanks.
What are you rendering your map with, or should I say what do you want to render it with? I use OpenGL, I assume you're using that?
I used to use SDL for rendering before I moved over to Qt but now I want to use Qt's functions. I never really used OpenGl.
I suggest looking into learning OpenGL before anything, it's not as complicated as you first might think, trust me. Once you're confident, try learning about QGLWidgets in QT and also learning about the sharedWidget property in the QGLWidget constructor to pass things back and forth between widgets so you can make the map editor work properly without loads of run time errors with white texture and loads of other problems.

If you need to ask any questions, feel free to and I'll try to help the best I can. I still need to remake my Toolkit again as I keep striving towards a very open OO design and I keep starting over not feeling satisfied.
Rendering with Opengl in Qt then is simple? Do you need to change any of your Opengl code to work in Qt?
It depends on what you mean exactly, you would be going from what to what? What are you using Qt for?

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Wed Aug 17, 2011 4:04 am
by xx6heartless6xx
LeonBlade wrote:
xx6heartless6xx wrote:
LeonBlade wrote:
xx6heartless6xx wrote:
LeonBlade wrote:
xx6heartless6xx wrote:Hey Leon, your level editor looks really cool and I want to make mine like it. I was wondering how you display your level on the screen in Qt. I have my layout like this in the image and want to display the level in the large white area in the center of my program.
level.png
My level editor also reads from a .map file where each tile has an id and it reads from the .map file and shows the tile it should. I'll post code if I'm not being clear enough. Thanks.
What are you rendering your map with, or should I say what do you want to render it with? I use OpenGL, I assume you're using that?
I used to use SDL for rendering before I moved over to Qt but now I want to use Qt's functions. I never really used OpenGl.
I suggest looking into learning OpenGL before anything, it's not as complicated as you first might think, trust me. Once you're confident, try learning about QGLWidgets in QT and also learning about the sharedWidget property in the QGLWidget constructor to pass things back and forth between widgets so you can make the map editor work properly without loads of run time errors with white texture and loads of other problems.

If you need to ask any questions, feel free to and I'll try to help the best I can. I still need to remake my Toolkit again as I keep striving towards a very open OO design and I keep starting over not feeling satisfied.
Rendering with Opengl in Qt then is simple? Do you need to change any of your Opengl code to work in Qt?
It depends on what you mean exactly, you would be going from what to what? What are you using Qt for?
I'm using Qt because I want to create a level editor where someone else can use it to design levels without having to touch code or know how to code. The UI of your level editor is almost exactly what I am trying to create. The difficulty I am having is I am not sure how to be able to display the current map I am editing on the right side in one widget and on the left showing the tilesheet so I can switch between the current tile selected.

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Sun Aug 21, 2011 8:27 am
by LeonBlade
xx6heartless6xx wrote:
LeonBlade wrote:
xx6heartless6xx wrote:
LeonBlade wrote:
xx6heartless6xx wrote:
LeonBlade wrote:
xx6heartless6xx wrote:Hey Leon, your level editor looks really cool and I want to make mine like it. I was wondering how you display your level on the screen in Qt. I have my layout like this in the image and want to display the level in the large white area in the center of my program.
level.png
My level editor also reads from a .map file where each tile has an id and it reads from the .map file and shows the tile it should. I'll post code if I'm not being clear enough. Thanks.
What are you rendering your map with, or should I say what do you want to render it with? I use OpenGL, I assume you're using that?
I used to use SDL for rendering before I moved over to Qt but now I want to use Qt's functions. I never really used OpenGl.
I suggest looking into learning OpenGL before anything, it's not as complicated as you first might think, trust me. Once you're confident, try learning about QGLWidgets in QT and also learning about the sharedWidget property in the QGLWidget constructor to pass things back and forth between widgets so you can make the map editor work properly without loads of run time errors with white texture and loads of other problems.

If you need to ask any questions, feel free to and I'll try to help the best I can. I still need to remake my Toolkit again as I keep striving towards a very open OO design and I keep starting over not feeling satisfied.
Rendering with Opengl in Qt then is simple? Do you need to change any of your Opengl code to work in Qt?
It depends on what you mean exactly, you would be going from what to what? What are you using Qt for?
I'm using Qt because I want to create a level editor where someone else can use it to design levels without having to touch code or know how to code. The UI of your level editor is almost exactly what I am trying to create. The difficulty I am having is I am not sure how to be able to display the current map I am editing on the right side in one widget and on the left showing the tilesheet so I can switch between the current tile selected.
That's the problems I was having for a while ;) You should check out this video I made.

Watch around 9:00 or so.

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Mon Sep 05, 2011 1:57 am
by xx6heartless6xx
LeonBlade wrote:
xx6heartless6xx wrote: I'm using Qt because I want to create a level editor where someone else can use it to design levels without having to touch code or know how to code. The UI of your level editor is almost exactly what I am trying to create. The difficulty I am having is I am not sure how to be able to display the current map I am editing on the right side in one widget and on the left showing the tilesheet so I can switch between the current tile selected.
That's the problems I was having for a while ;) You should check out this video I made.

Watch around 9:00 or so.
Thanks for the help Leonblade, I'm still finding my way around opengl but thanks for pointing me in the right direction. Anyway your engine is looking pretty nice. Keep up the hard work and keep up us updated here and on the youtubes.

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Mon Sep 05, 2011 7:54 am
by superLED
What's the point of that post? it's just a quote x)

Edit: This post doesn't count anymore since a mod cleaned up a bit on the quotes :p

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Mon Sep 05, 2011 8:06 am
by koolgraph
he just put this
Thanks for the help Leonblade, I'm still finding my way around opengl but thanks for pointing me in the right direction. Anyway your engine is looking pretty nice. Keep up the hard work and keep up us updated here and on the youtubes
in leon's quote

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Posted: Mon Sep 05, 2011 8:20 am
by LeonBlade
koolgraph wrote:he just put this
Thanks for the help Leonblade, I'm still finding my way around opengl but thanks for pointing me in the right direction. Anyway your engine is looking pretty nice. Keep up the hard work and keep up us updated here and on the youtubes
in leon's quote
Lol yeah I noticed :lol: