Blade Brothers Engine: Creating my first 2D Game 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

Post Reply
User avatar
GroundUpEngine
Chaos Rift Devotee
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

Post by GroundUpEngine »

I like the design, simple but effective ;)
User avatar
LeonBlade
Chaos Rift Demigod
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

Post by LeonBlade »

This thing is frustrating... well... sort of...
The thing with doing this in SDL is that it's a pain in the fucking ass because I have no UI controls to give me ease of use...

I COULD do it in SDL entirely and have a fuck load of extra work that I don't want to do.
Basically have have the tilesheet on the right like described and the controls at the top.

Buttons will move the tilesheet up and down (because it doesn't all fit on the damn screen.
Then I'll need to keep track of how much I've scrolled so I know which tile I'm referencing based on the cursor position
of the tile.

UNLESS, I instead decide to attach an event on to each tile sprite that will react to you clicking it inside it's own "box" and then returning information back so that I can change tile information.
Then it doesn't matter where I am scroll wise, because all the tile clicking is done on each individual sprite and returned back from that click function.

That would make things easier in a way, but then I'd have to either extend the sprite class or make another class that inherits from the Sprite class to get the clicking in place. And adding a class JUST for the level editor seems pointless for the actual engine.

So I was thinking... should I instead make my map editor in another language?
As stupid as this sounds to most I'm sure, I was thinking about making it in Adobe AIR.

What do you all think about this?
There's no place like ~/
Live-Dimension
Chaos Rift Junior
Chaos Rift Junior
Posts: 345
Joined: Tue Jan 12, 2010 7:23 pm
Favorite Gaming Platforms: PC - Windows 7
Programming Language of Choice: c++;haxe
Contact:

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

Post by Live-Dimension »

I'd render the map in SDL, and use some sort of widget system for map editor UI.

IE, look at Marcel's editor, or most other "professional" editors.
Last edited by Live-Dimension on Thu Mar 18, 2010 6:23 am, edited 2 times in total.
Image
User avatar
LeonBlade
Chaos Rift Demigod
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

Post by LeonBlade »

Live-Dimension wrote:I'd render the map in SDL, and use some sort of widget system for map editor UI.

IE, look at Marcel's editor, or most other "professional" editors.
That's what I was thinking, but I wasn't sure.
I'll have to have some other way of displaying the tilesheet that isn't with SDL.

I'll take a look into it more after I wake up.
There's no place like ~/
quickshot14
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 31
Joined: Thu Mar 11, 2010 2:51 am
Current Project: VB.NET Direct X Game Engine (Working Title)
Favorite Gaming Platforms: PC
Programming Language of Choice: VB.NET (for now)
Location: Nebreska, USA
Contact:

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

Post by quickshot14 »

LeonBlade wrote:
Live-Dimension wrote:I'd render the map in SDL, and use some sort of widget system for map editor UI.

IE, look at Marcel's editor, or most other "professional" editors.
That's what I was thinking, but I wasn't sure.
I'll have to have some other way of displaying the tilesheet that isn't with SDL.

I'll take a look into it more after I wake up.

Thats kind of the approch I was looking at with my vb.net project I already have a small barley function editor in place, right now it just can load and save map information files, but what I have in the back of my mind is essincly using
the standard vb.net, like i already started, to do most elments of the editor and for the acutal map display, use managed directx to draw that all out so it looks basicly like it should in the acutal game. So yeah totaly makes sense and is
a good way to go and should hopefully make your job of creating it a little easier if not a lot easier.
Amatuer Game Design/Programmer & College Student (Kaplan University: Associate of Applied Sceince in Information Technology: Application Devleopment)
Know Programming Languages & Considered Levels Of Programming in them: Basic(DOS) - 10%, VB(Legacy) - 15%, VB.NET - 55%, C/C++ - 1%, C# - 1%, LUA - 25%, Java - 0%, COBOL - 0%
________________________________________________
Current Game Development/Programming Projects:
VB.NET Direct X Game Engine (Working Title) - (Lanugage: VB.NET | Released Type/Status: Open Soruce / Unreleased)
________________________________________________
Quicks14Blog (My Gaming Related Blog Page) - My Youtube Channel Page
User avatar
LeonBlade
Chaos Rift Demigod
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

Post by LeonBlade »

I really don't know what I'm going to do... I could port everything to OpenGL instead and try to start from there... what do you think?
The map editor is just starting to become a huge pain in the ass, my existing code for my SDL project is way to complicated to edit and change shit with so... what do you think?

I think I'll just start learning OpenGL for 2D, plus it's better than SDL and I'll be able to go through and rewrite everything in a namespace.
What do you all think?
There's no place like ~/
User avatar
Milch
Chaos Rift Junior
Chaos Rift Junior
Posts: 241
Joined: Sat Jul 11, 2009 5:55 am
Programming Language of Choice: C++
Location: Austria, Vienna

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

Post by Milch »

I did the same thing on my engine.
This gave me the chance to rewrite everything to make it more modular and add a bunch of new features ( like implementing AngelScript ).
So do it!
Follow me on twitter!
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

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

Post by eatcomics »

LeonBlade wrote:I really don't know what I'm going to do... I could port everything to OpenGL instead and try to start from there... what do you think?
The map editor is just starting to become a huge pain in the ass, my existing code for my SDL project is way to complicated to edit and change shit with so... what do you think?

I think I'll just start learning OpenGL for 2D, plus it's better than SDL and I'll be able to go through and rewrite everything in a namespace.
What do you all think?
I'd say it depends. If you do OGL you're still gonna have to deal with SDL, or SFML. If you want like rotation and lighting and stuff, then yeah go for it. But if you don't I'd say go with SDL... I think it would be easier that way. I'd say just restructure your stuff with an editor in mind. What problems are you having with the editor?

I don't see why you need something besides SDL for displaying tilesheets? And you don't necessarily need a UI system, maybe just some simple functions for creating buttons and lists or something. Maybe something for windows, but really I think if you're having problems in SDL you're going to have lots of problems in OGL, then where will you go?

Although I have to say, I'm really enjoying OpenGL and you should definitely try some OGL before you really decide.
Image
User avatar
GroundUpEngine
Chaos Rift Devotee
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

Post by GroundUpEngine »

LeonBlade wrote:I really don't know what I'm going to do... I could port everything to OpenGL instead and try to start from there... what do you think?
The map editor is just starting to become a huge pain in the ass, my existing code for my SDL project is way to complicated to edit and change shit with so... what do you think?

I think I'll just start learning OpenGL for 2D, plus it's better than SDL and I'll be able to go through and rewrite everything in a namespace.
What do you all think?
You don't have to port or rewrite in another language, just make a GUI and Keyboard/Mouse Input class in your engine and do the Rendering with SDL...
If a map works in your editor(engine as core) then it will work in your game(engine as core), don't over complicate things ;)

p.s. GUI can be used in a game, not just for an editor or tool
User avatar
LeonBlade
Chaos Rift Demigod
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

Post by LeonBlade »

Sorry, I was dealing with a lot of issues and my head wasn't straight when I first started tackling these problems.
I'm going to continue doing this map editor in SDL like I originally planned.

I plan on making the input class that will handle Mouse and Keyboard events.
The sprites will each have their own bounding box in which if you click in you can activate a click function.

I wanted to have a separate panel for the tilesheet, but because of how I'm doing this, that is out of the question.
My plans are to just make the size of the window wider to fit the tilesheet and tools on the right like I planned on before.

Each tile will return it's tile ID when you click it so that I can set the currently used tile as the one I selected.

Because the full tileset isn't gonna fit on the damn screen, I'll add some UI elements that will allow you to scroll up/down to select tiles that can't be displayed.

Oh, and I want to use ColorKey to set a certain color to be transparent... except... I can't get that to work...
So, I'm just using a regular PNG with transparency instead :roll:

In fact, now that I think of it, I'm going to create a whole UI class that can handle a few things like...
  • Button
  • Alert boxes
  • Input boxes
  • List views
  • Various pre-built dialogs like open and save map
...and some others in the future.

All UI elements will inherit from sprites, and have their own properties to them that makes them unique such as clicking for buttons and being able to type in input boxes etc.

I don't know if I'll work on this tonight while it's fresh in my head or not, it's 4:21 AM right now :lol:
I'm going to grab a Mountain Dew... we'll see what happens.
There's no place like ~/
User avatar
LeonBlade
Chaos Rift Demigod
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

Post by LeonBlade »

Alright, I had a problem with the function pointers but I fixed that...
I converted my whole project to a BBE namespace instead of having BBEClass for every file name :lol:
Last edited by LeonBlade on Tue Mar 23, 2010 5:06 am, edited 1 time in total.
There's no place like ~/
User avatar
GroundUpEngine
Chaos Rift Devotee
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

Post by GroundUpEngine »

LeonBlade wrote: The error I'm getting is, that 'Button' has not been declared what on earth is this shit?
I must be doing something wrong, can someone assist me?
Wrap both the class declaration and the class function declarations with your namespace bro ;)
User avatar
LeonBlade
Chaos Rift Demigod
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

Post by LeonBlade »

GroundUpEngine wrote:
LeonBlade wrote: The error I'm getting is, that 'Button' has not been declared what on earth is this shit?
I must be doing something wrong, can someone assist me?
Wrap both the class declaration and the class function declarations with your namespace bro ;)
Ahh! Thank you!!! :)
There's no place like ~/
User avatar
MrDeathNote
ES Beta Backer
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

Post by MrDeathNote »

LeonBlade wrote: Oh, and I want to use ColorKey to set a certain color to be transparent... except... I can't get that to work...
So, I'm just using a regular PNG with transparency instead :roll:
What code where you using for the ColorKey?
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"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
User avatar
LeonBlade
Chaos Rift Demigod
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

Post by LeonBlade »

MrDeathNote wrote:
LeonBlade wrote: Oh, and I want to use ColorKey to set a certain color to be transparent... except... I can't get that to work...
So, I'm just using a regular PNG with transparency instead :roll:
What code where you using for the ColorKey?
I just was about to get you or someone else to help me out, but I got it working.
Only problem is, I have to use BMP files in order for it to work right... what the fuck is this shit?
There's no place like ~/
Post Reply