Blade Brothers Engine: Creating my first 2D Game Engine
Moderator: PC Supremacists
- LeonBlade
- Chaos Rift Demigod
- Posts: 1314
- Joined: Thu Jan 22, 2009 12:22 am
- Current Project: Trying to make my first engine in C++ using OGL
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: Blossvale, NY
Re: Blade Brothers Engine: Creating my first 2D Game Engine
REBIRTH
Hello everyone, it's been a long time.
http://www.youtube.com/watch?v=rcVeEFJk148
Please take note before watching, I'm redoing the way I handle Lua thanks to short and GyroVorbis as it appears I fucked up completely on how I'm going about this! So try not to facepalm to hard at my failures.
Hello everyone, it's been a long time.
http://www.youtube.com/watch?v=rcVeEFJk148
Please take note before watching, I'm redoing the way I handle Lua thanks to short and GyroVorbis as it appears I fucked up completely on how I'm going about this! So try not to facepalm to hard at my failures.
There's no place like ~/
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Nice work man, good to see this project again! I like all the control used via Lua
But I also agree with Falco, don't let Lua do everything... find a balance!
Instead of std::vector or whatever, for the first entity indexed on the stack.
Try std::map, with the first player on the stack. I use this from time to time..
But I also agree with Falco, don't let Lua do everything... find a balance!
Instead of std::vector or whatever, for the first entity indexed on the stack.
Code: Select all
Entity::EntityStack[0]...
Code: Select all
Entity::EntityStack["player1"]...
// So beforehand you can ->
Entity* ent = new Player();
Entity::EntityStack["player1"] = ent;
- LeonBlade
- Chaos Rift Demigod
- Posts: 1314
- Joined: Thu Jan 22, 2009 12:22 am
- Current Project: Trying to make my first engine in C++ using OGL
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: Blossvale, NY
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Here is a link back to the question I posted earlier on Lua and C++ balance.
http://elysianshadows.com/phpBB3/viewto ... =13&t=6014
Again, thanks to short and GyroVorbis for putting me in the right direction as to how I should go about implementing Lua.
I'm pretty sure some of my Lua functions that are overloaded are in the right place, but the way I'm handling everything else is terribly terribly wrong.
I'll be creating a small little project (terminal based) for Lua and a dialog system so that I can get a better understanding as to what I need to be doing.
If you'd like to check out my Engine thus far, feel free to clone it like so:
Please be warned though, the Lua implementation again like I said is awful, and I'll be pushing changes to it later on in the day.
If you would like to help me tackle my Toolkit issues, that is in the git repo and I'm using Qt 4.7. Feel free to check it out, and let me know if you have any issues running it as the Run path needs to be set to the right spot otherwise it fails.
I'll be sorting out how I should go about that pretty soon, I have to do some revisions as to how I'm going about all this Lua nonsense.
http://elysianshadows.com/phpBB3/viewto ... =13&t=6014
Again, thanks to short and GyroVorbis for putting me in the right direction as to how I should go about implementing Lua.
I'm pretty sure some of my Lua functions that are overloaded are in the right place, but the way I'm handling everything else is terribly terribly wrong.
I'll be creating a small little project (terminal based) for Lua and a dialog system so that I can get a better understanding as to what I need to be doing.
If you'd like to check out my Engine thus far, feel free to clone it like so:
Code: Select all
git clone git://github.com/LeonBlade/Blade-Brothers-Engine.git
If you would like to help me tackle my Toolkit issues, that is in the git repo and I'm using Qt 4.7. Feel free to check it out, and let me know if you have any issues running it as the Run path needs to be set to the right spot otherwise it fails.
Thanks a lot, man. It's projects like yours and others out there that motivated me back into working.GroundUpEngine wrote:Nice work man, good to see this project again! I like all the control used via Lua
Instead of std::vector or whatever, for the first entity indexed on the stack.Try std::map, with the first player on the stack. I use this from time to time..Code: Select all
Entity::EntityStack[0]...
Code: Select all
Entity::EntityStack["player1"]... // So beforehand you can -> Entity* ent = new Player(); Entity::EntityStack["player1"] = ent;
I'll be sorting out how I should go about that pretty soon, I have to do some revisions as to how I'm going about all this Lua nonsense.
There's no place like ~/
- LeonBlade
- Chaos Rift Demigod
- Posts: 1314
- Joined: Thu Jan 22, 2009 12:22 am
- Current Project: Trying to make my first engine in C++ using OGL
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: Blossvale, NY
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Changes are also pushed to the repo, not sure if everything will work out of the box, but it should work just fine.
Toolkit is in the stages of being remade, so it wont work what so ever, Engine should compile fine platform issues aside.
Still need to address the scrolling issue, but that will come later.
There's no place like ~/
Re: Blade Brothers Engine: Creating my first 2D Game Engine
To check if snapped to grid just use modulo, and split up movements into numbers divisible by grid number.
You are unable to move outside the map in some places because I'm assuming that you are accessing out of bounds data.
You are unable to move outside the map in some places because I'm assuming that you are accessing out of bounds data.
- LeonBlade
- Chaos Rift Demigod
- Posts: 1314
- Joined: Thu Jan 22, 2009 12:22 am
- Current Project: Trying to make my first engine in C++ using OGL
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: Blossvale, NY
Re: Blade Brothers Engine: Creating my first 2D Game Engine
I already have grid snapping working just fine along with multiple other things like multiple tile selection etc.bnpph wrote:To check if snapped to grid just use modulo, and split up movements into numbers divisible by grid number.
You are unable to move outside the map in some places because I'm assuming that you are accessing out of bounds data.
The problem is the widget doesn't scroll and it offsets everything.
And the player being stopped by the map doesn't make any sense, there are no bounds of data in this case just a number telling where OpenGL needs to render a quad.
There's no place like ~/
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Oh, I guess I saw that from an outdated video - the new one looks good!I already have grid snapping working just fine along with multiple other things like multiple tile selection etc.
Why not translate the GL matrix to match the scroll amount?The problem is the widget doesn't scroll and it offsets everything.
That's strange. Does it happen without the grid snapping code?And the player being stopped by the map doesn't make any sense, there are no bounds of data in this case just a number telling where OpenGL needs to render a quad.
- LeonBlade
- Chaos Rift Demigod
- Posts: 1314
- Joined: Thu Jan 22, 2009 12:22 am
- Current Project: Trying to make my first engine in C++ using OGL
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: Blossvale, NY
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Ha, yeah it's fine man. I'm hoping to put the selection back in because I started from scratch AGAIN. It was really rough last time, so hopefully I can make it a lot better.bnpph wrote:Oh, I guess I saw that from an outdated video - the new one looks good!I already have grid snapping working just fine along with multiple other things like multiple tile selection etc.
Why not translate the GL matrix to match the scroll amount?The problem is the widget doesn't scroll and it offsets everything.
That's strange. Does it happen without the grid snapping code?And the player being stopped by the map doesn't make any sense, there are no bounds of data in this case just a number telling where OpenGL needs to render a quad.
And yes! I think that's my problem... I just don't ever remember having to do it before, you know? So I was confused... hopefully I'll get that issue solved shortly. I'm adding just straight QGLWidgets to a QTabWidget so I need to change a few chunks of code to make the change work to add the QScrollArea back in.
And yeah, I'm not really sure why that happened... I haven't looked at it since then actually. I should put in the collision of the map edges anyways, I think I'll do that next.
Thanks for the reply by the way, very appreciated!
There's no place like ~/
- THe Floating Brain
- Chaos Rift Junior
- Posts: 284
- Joined: Tue Dec 28, 2010 7:22 pm
- Current Project: RTS possible Third Person shooter engine.
- Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
- Programming Language of Choice: C/C++, Python 3, C#
- Location: U.S
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Very nice work
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself
- LeonBlade
- Chaos Rift Demigod
- Posts: 1314
- Joined: Thu Jan 22, 2009 12:22 am
- Current Project: Trying to make my first engine in C++ using OGL
- Favorite Gaming Platforms: PS3
- Programming Language of Choice: C++
- Location: Blossvale, NY
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Thanks man!THe Floating Brain wrote:Very nice work
Finally got auto-tiles working! Next will be making them work better and then start back on the Toolkit... again...
There's no place like ~/
- MrDeathNote
- ES Beta Backer
- Posts: 594
- Joined: Sun Oct 11, 2009 9:57 am
- Current Project: cocos2d-x project
- Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
- Programming Language of Choice: C/++
- Location: Belfast, Ireland
- Contact:
Re: Blade Brothers Engine: Creating my first 2D Game Engine
So are you calculating the autotiles every time they're rendered? Why not do your calculations and then edit the actual layer so that once you've edited it it'll persist. In fact you don't even need them in the engine at all, why not just have the calculations performed in the editor then just have your tile layout stored the same as normal. I might be missing something here since i'm in work and i'm trying to look productive while watching this
http://www.youtube.com/user/MrDeathNote1988
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Well, all the calculations can't be stored solely in the editor, because he's laying tiles in the actual engine, right? But editing the actual tile layer is definitely a good idea imo.MrDeathNote wrote:So are you calculating the autotiles every time they're rendered? Why not do your calculations and then edit the actual layer so that once you've edited it it'll persist. In fact you don't even need them in the engine at all, why not just have the calculations performed in the editor then just have your tile layout stored the same as normal. I might be missing something here since i'm in work and i'm trying to look productive while watching this
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Well, one could actually have all the autotile calculations be done when you change tiles rather than when you render them. That would not only save CPU time, it would also make your life at least a little easier.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Yeah, you only need to update the 8 adjacent tiles of the one that has been changed.Ginto8 wrote:Well, one could actually have all the autotile calculations be done when you change tiles rather than when you render them. That would not only save CPU time, it would also make your life at least a little easier.
- MrDeathNote
- ES Beta Backer
- Posts: 594
- Joined: Sun Oct 11, 2009 9:57 am
- Current Project: cocos2d-x project
- Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
- Programming Language of Choice: C/++
- Location: Belfast, Ireland
- Contact:
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Isn't that what I said?Ginto8 wrote:Well, one could actually have all the autotile calculations be done when you change tiles rather than when you render them. That would not only save CPU time, it would also make your life at least a little easier.
He's loading the file from the editor, if he's going to edit the layer he could do that in the editor. The visual effect would be the same in the engine since he would be loading the same data that he's calulating at runtime now. This is all assuming that he doesn't want to edit the level at runtime in the engine, if he does then I take back what I just said.XianForce wrote: Well, all the calculations can't be stored solely in the editor, because he's laying tiles in the actual engine, right?
http://www.youtube.com/user/MrDeathNote1988
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup