You're better off just using a regular PNG with transparencies anyway. In the hardware accelerated world (OpenGL), you never mask colors. You just use textures that have transparency. It's less of a pain in the ass in the long run.LeonBlade wrote:I just was about to get you or someone else to help me out, but I got it working.MrDeathNote wrote:What code where you using for the ColorKey?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
Only problem is, I have to use BMP files in order for it to work right... what the fuck is this shit?
Blade Brothers Engine: Creating my first 2D Game Engine
Moderator: PC Supremacists
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Blade Brothers Engine: Creating my first 2D Game Engine
- 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
/agreedGyroVorbis wrote:You're better off just using a regular PNG with transparencies anyway. In the hardware accelerated world (OpenGL), you never mask colors. You just use textures that have transparency. It's less of a pain in the ass in the long run.LeonBlade wrote:I just was about to get you or someone else to help me out, but I got it working.MrDeathNote wrote:What code where you using for the ColorKey?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
Only problem is, I have to use BMP files in order for it to work right... what the fuck is this shit?
- 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
Very true, thats exactly what i'm doing in my rpg engine with opengl. I looked at scanning through each pixel and adding an extra channel for alpha, but holy fuck was it a pain in the ass lol.GyroVorbis wrote:You're better off just using a regular PNG with transparencies anyway. In the hardware accelerated world (OpenGL), you never mask colors. You just use textures that have transparency. It's less of a pain in the ass in the long run.LeonBlade wrote:I just was about to get you or someone else to help me out, but I got it working.MrDeathNote wrote:What code where you using for the ColorKey?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
Only problem is, I have to use BMP files in order for it to work right... what the fuck is this shit?
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
- 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
Alright, thank you everyone for your responses.
I'll continue to use transparent PNGs instead of ColorKey.
The only thing is, when I use the map editor, and I want to use a transparent tile on ground, it shows up as transparent, but when you click, it makes it black (the screen color).
What should I do for this? Should I just make a seperate black tile or what?
I'll continue to use transparent PNGs instead of ColorKey.
The only thing is, when I use the map editor, and I want to use a transparent tile on ground, it shows up as transparent, but when you click, it makes it black (the screen color).
What should I do for this? Should I just make a seperate black tile or what?
There's no place like ~/
-
- 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
Falco just nailed it its much simpler easier and of course standard pretty much to use in my vb.net project i'm using pngs for there transparencies and it really is easy. And definlty saves times and issues. You have a good questions and granted i'm not this far on the step yet (working on a tile editor) i belive having a seprate black tile is something thats normal or basic, if my memory servers i belive even mappy does this. So that is a possiblity unless there is a better way of doing or handling it witch more experinced people here may have and idea on.GyroVorbis wrote:You're better off just using a regular PNG with transparencies anyway. In the hardware accelerated world (OpenGL), you never mask colors. You just use textures that have transparency. It's less of a pain in the ass in the long run.LeonBlade wrote:I just was about to get you or someone else to help me out, but I got it working.MrDeathNote wrote:What code where you using for the ColorKey?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
Only problem is, I have to use BMP files in order for it to work right... what the fuck is this shit?
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
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
- 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
This is what the editor looks like atm... shitty graphics I know (I can't sprite )
I'm gonna add in the side panel to load all the sprites and UI to scroll through the full tilesheet.
Then I'm going to add scrolling for the map...
Then I'm going to make the buttons do shit at the top there
Finish up the UI classes to handle some dialogs for New/Open/Save and some other shit as well.
So that's my plan of attack for the next few days or so.
There's no place like ~/
-
- 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
Awsome man! Looks like a good start and a plan of attack, things will probley change but hey that happens no matter what its progress and thats always encourging, looks goodLeonBlade wrote:
This is what the editor looks like atm... shitty graphics I know (I can't sprite )
I'm gonna add in the side panel to load all the sprites and UI to scroll through the full tilesheet.
Then I'm going to add scrolling for the map...
Then I'm going to make the buttons do shit at the top there
Finish up the UI classes to handle some dialogs for New/Open/Save and some other shit as well.
So that's my plan of attack for the next few days or so.
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
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
- 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 just realized that scrolling my map is going to be a bitch...
Everything is loaded onto a single dimension LOL.
So here's how I'm going to have to do this if I continue to just load tiles in on a single dimension.
Lets say I'm 3 tiles over...
I have to start 3 tiles over so 3 times the tiles high and then get all tiles from my position over and BLAH BLAH
I DONT EVEN WANNA WRITE IT OUT IM BUSY
So yeah... I'll have to reconfigure that unless I wanna do extra work
Everything is loaded onto a single dimension LOL.
So here's how I'm going to have to do this if I continue to just load tiles in on a single dimension.
Lets say I'm 3 tiles over...
I have to start 3 tiles over so 3 times the tiles high and then get all tiles from my position over and BLAH BLAH
I DONT EVEN WANNA WRITE IT OUT IM BUSY
So yeah... I'll have to reconfigure that unless I wanna do extra work
There's no place like ~/
- RyanPridgeon
- Chaos Rift Maniac
- Posts: 447
- Joined: Sun Sep 21, 2008 1:34 pm
- Current Project: "Triangle"
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C/C++
- Location: UK
- Contact:
Re: Blade Brothers Engine: Creating my first 2D Game Engine
Aye, you'll wanna be doing something which only renders the tile in view of the camera. Something like
Code: Select all
for (i = cameraX / tileWidth; i < (cameraX + screenW) / tileWidth; i++){
for (j = cameraY / tileHeight; j < (cameraY + screenH) / tileHeight; j++){
renderTile(tiles[i][j], i * tileWidth - cameraX, j * tileHeight - cameraY)
}
}
- 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
Yea this is pretty much what your gonna have to do, it works well and i've used it myself.RyanPridgeon wrote:Aye, you'll wanna be doing something which only renders the tile in view of the camera. Something like
Code: Select all
for (i = cameraX / tileWidth; i < (cameraX + screenW) / tileWidth; i++){ for (j = cameraY / tileHeight; j < (cameraY + screenH) / tileHeight; j++){ renderTile(tiles[i][j], i * tileWidth - cameraX, j * tileHeight - cameraY) } }
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
- 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 guys, I could of planned it out like I normally do when I write the topic concerning my issue.MrDeathNote wrote:Yea this is pretty much what your gonna have to do, it works well and i've used it myself.RyanPridgeon wrote:Aye, you'll wanna be doing something which only renders the tile in view of the camera. Something like
Code: Select all
for (i = cameraX / tileWidth; i < (cameraX + screenW) / tileWidth; i++){ for (j = cameraY / tileHeight; j < (cameraY + screenH) / tileHeight; j++){ renderTile(tiles[i][j], i * tileWidth - cameraX, j * tileHeight - cameraY) } }
However, I was under a lot of shit atm and VERY tired thank you for your help
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
I'm thinking ahead at the moment, but I want to obviously use Lua as my scripting language in my engine.
What I want to do, is have Events essentially on my map.
You can create either: NPCs, Signs and Scripts.
Each event ties back to a script, I want to have my events in my map file look like this...
Which is first the ID of the event so I can reference it from other events.
Then Event Type which is either 00, 01 or 02.
Then X and Y for position on the map.
Then there's Sprite which will be the sprite ID of the event or 00 if there is no sprite.
Then the Face of the sprite. This value is either 00, 01, 02, or 03 (4 faces). The value is used for NPCs to chose what way they face.
Then Moving is just a 00 or 01 value. Either they're not moving or they are. The moving is just a random movement.
The last is Script and that is the script ID that the event is associated with.
Now, there are two issues I need to address.
First off, is how I'm going to compile a list of Sprites to associate with the Sprite ID.
Sprites will be stored in a sprite folder.
There will be a tool created that will allow you to add sprites to a list and save out a binary file that will store the name of the sprite texture file and the ID associated with it. The byte FF will signify the end of a filename string.
Here is an example of 3 sprites (in readable form)
Each sprite file is going to be a different length, so instead of just wasting space by creating a static size, I will just use the byte FF to separate the end of the texture.
Here is that same list in hex:
In the actual file, they wouldn't be split up on lines (obviously) but I did this so you could see the break more easily.
So when the engine starts it parses the sprite binary file and adds the sprite textures to the Sprite Texture Manager.
Same goes with the scripts as well, those can be taken care of with a script manager as well.
A separate manager class can be created to handle loading those in, however, I'm not entirely sure how to link Lua up to C++ yet so I'm not sure what I'll do until I read up some more.
But yeah, figured I'd get that down so I don't forget later
Let me know what you think.
ALSO! The editor in SDL is kind of coming along... not really though.
I'm currently working on it though... so I'll let you know how that goes.
I think I'm looking too much into the big picture.
I'll just focus on the UI alone first then I'll worry about the entire map editor later.
So far, Buttons have been created... that's it... lol.
Well that is all.
What I want to do, is have Events essentially on my map.
You can create either: NPCs, Signs and Scripts.
Each event ties back to a script, I want to have my events in my map file look like this...
Code: Select all
00 00 06 07 03 01 00 01
Then Event Type which is either 00, 01 or 02.
Then X and Y for position on the map.
Then there's Sprite which will be the sprite ID of the event or 00 if there is no sprite.
Then the Face of the sprite. This value is either 00, 01, 02, or 03 (4 faces). The value is used for NPCs to chose what way they face.
Then Moving is just a 00 or 01 value. Either they're not moving or they are. The moving is just a random movement.
The last is Script and that is the script ID that the event is associated with.
Now, there are two issues I need to address.
First off, is how I'm going to compile a list of Sprites to associate with the Sprite ID.
Sprites will be stored in a sprite folder.
There will be a tool created that will allow you to add sprites to a list and save out a binary file that will store the name of the sprite texture file and the ID associated with it. The byte FF will signify the end of a filename string.
Here is an example of 3 sprites (in readable form)
Code: Select all
01 "hero.png"
02 "evil_bad_guy.png"
03 "warrior3.png"
Here is that same list in hex:
Code: Select all
01 68 65 72 6f 2e 70 6e 67 FF
02 65 76 69 6c 5f 62 61 64 5f 67 75 79 2e 70 6e 67 FF
03 77 61 72 72 69 6f 72 33 2e 70 6e 67 FF
So when the engine starts it parses the sprite binary file and adds the sprite textures to the Sprite Texture Manager.
Same goes with the scripts as well, those can be taken care of with a script manager as well.
A separate manager class can be created to handle loading those in, however, I'm not entirely sure how to link Lua up to C++ yet so I'm not sure what I'll do until I read up some more.
But yeah, figured I'd get that down so I don't forget later
Let me know what you think.
ALSO! The editor in SDL is kind of coming along... not really though.
I'm currently working on it though... so I'll let you know how that goes.
I think I'm looking too much into the big picture.
I'll just focus on the UI alone first then I'll worry about the entire map editor later.
So far, Buttons have been created... that's it... lol.
Well that is all.
There's no place like ~/
-
- 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
FF is a bad choice. I don't know how moddable you plan to make a game, but FF is an allowed character in the windows file naming system, so as such, can be input as a file name. I do know that some characters are banned for file/folder names, such as the question mark "?" (3F). I don't know if it's also a banned name on unix systems. If it is, then it's a better way to differ between files then FF, which is ÿ. Thankfully, I don't thing that unicode is apart of any file/folder naming system, so you only have to deal with ASCII, but I could be totally wrong.Each sprite file is going to be a different length, so instead of just wasting space by creating a static size, I will just use the byte FF to separate the end of the texture.
Here is that same list in hex:Code: Select all
01 68 65 72 6f 2e 70 6e 67 FF 02 65 76 69 6c 5f 62 61 64 5f 67 75 79 2e 70 6e 67 FF 03 77 61 72 72 69 6f 72 33 2e 70 6e 67 FF
I do like the idea of your sprite management system, linking sprites directly to ID's.
I'm also going to assume that you realise you need more then 8 bytes for what your planning As I'm sure you know, each byte is only capable of 256 unique values. It's just you seem insistent on using a maximum of 256 events, 256 sprites.... upto 256 X/Y positioning.Each event ties back to a script, I want to have my events in my map file look like this...Code: Select all
00 00 06 07 03 01 00 01
There's some things about your idea of events that confuse me, so if you don't mind (if more for personal curiosity/learning then anything else)
Why do you need a sprite/facing/moving for an event? What triggers these events? Other events?Which is first the ID of the event so I can reference it from other events.
Then Event Type which is either 00, 01 or 02.
Then X and Y for position on the map.
Then there's Sprite which will be the sprite ID of the event or 00 if there is no sprite.
Then the Face of the sprite. This value is either 00, 01, 02, or 03 (4 faces). The value is used for NPCs to chose what way they face.
Then Moving is just a 00 or 01 value. Either they're not moving or they are. The moving is just a random movement.
The last is Script and that is the script ID that the event is associated with.
- 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
Hahahaha yeah I wrote this at like wicked early and didn't really think it through
The basic idea is there though...
Also, an even can be an NPC.
So the sprite/facing/moving is for NPCs.
Like I said, I have no idea what I was thinking about completely haha
I was basing it off of something else, I think I'll create NPCs and other Events separate...
Also, for the sprite manager, what should I use to break the different IDs apart... if at all...
Should I even MAKE a binary file for sprites?
The basic idea is there though...
Also, an even can be an NPC.
So the sprite/facing/moving is for NPCs.
Like I said, I have no idea what I was thinking about completely haha
I was basing it off of something else, I think I'll create NPCs and other Events separate...
Also, for the sprite manager, what should I use to break the different IDs apart... if at all...
Should I even MAKE a binary file for sprites?
There's no place like ~/
-
- 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
I don't see the need to. It's easier to mod and mess around with text-based files. I'd probably end up making final archive files to store all the files in, however.