mvEngine Development Thread

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
mv2112
Chaos Rift Junior
Chaos Rift Junior
Posts: 240
Joined: Sat Feb 20, 2010 4:15 am
Current Project: Java Tower Defence Game
Favorite Gaming Platforms: N64/Xbox 360/PC/GameCube
Programming Language of Choice: C/++, Java
Location: /usr/home/mv2112
Contact:

mvEngine Development Thread

Post by mv2112 »

First, i guess im working on a sort of game engine. Its in the VERY baby stages, but you can download the .exe here -> http://home.roadrunner.com/~mvonline/, it's in a zip file which contains the engine and the map editor. Tell me what you think of it? It's written in c++ and allegro. And now for my question:
What is an efficient way of storing and loading maps? Right now, my map file is like this:

Code: Select all

tile_sheet.bmp <- tile sheet to load tiles from
x x x x x x x x x x # x coordinates on screen and the # says to the engine "OMG, NO MORE VALUES ON THIS LINE!"
y y y y y y y y y y # y coordinates on screen
fx fx fx fx fx fx fx fx fx fx # x coordinate on tilesheet
fy fy fy fy fy fy fy fy fy fy # y coordinate on tilesheet
t t t t t t t t t t # type of file
w w w w w w w w w w # width of tiles
h h h h h h h h h h # height of tiles
All the letters represent integer values that get loaded into vectors in the engine.
basically, what i do is when i setup the map, i do a for loop:

Code: Select all

for(int i=0;i<map1->x.size();i++)
{
     masked_blit(MAP,tile_sheet.bmp,fx[i],fy[i],x[i],y[i]); //something like this
}
I saved the tile configuration to BITMAP * MAP because refreshing the map using the for loop itself was EXTREMELY slow.
My way of loading maps works fine, but is there a more efficient way of doing it? I don't know how good my way will be with very large maps.

Here is url to youtube video:
http://www.youtube.com/watch?v=7anw-W423UA
Last edited by mv2112 on Wed Apr 28, 2010 7:43 pm, edited 7 times in total.
User avatar
mv2112
Chaos Rift Junior
Chaos Rift Junior
Posts: 240
Joined: Sat Feb 20, 2010 4:15 am
Current Project: Java Tower Defence Game
Favorite Gaming Platforms: N64/Xbox 360/PC/GameCube
Programming Language of Choice: C/++, Java
Location: /usr/home/mv2112
Contact:

Re: Questions about loading maps and check out my new project!

Post by mv2112 »

Also, if for some reason you cant run the files, tell me so i can fix, iv never distributed my executables before.
User avatar
short
ES Beta Backer
ES Beta Backer
Posts: 548
Joined: Thu Apr 30, 2009 2:22 am
Current Project: c++, c
Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
Programming Language of Choice: c, c++
Location: Oregon, US

Re: Questions about loading maps and check out my new project!

Post by short »

http://www.wisdom-soft.com/products/aut ... r_free.htm

honestly I see lots of projects that say "HEY, DL MY .EXE KKTHX"

the above program will allow you to make a basic video of your project and youtube will host it for free. Just sayin

edit: I can't vouch for the program I linked, but I use it and don't believe there are any hidden surprises :)
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
User avatar
thejahooli
Chaos Rift Junior
Chaos Rift Junior
Posts: 265
Joined: Fri Feb 20, 2009 7:45 pm
Location: London, England

Re: Questions about loading maps and check out my new project!

Post by thejahooli »

That is really good, I'm looking forward to seeing where this project goes.
mv2112 wrote:Also, if for some reason you cant run the files, tell me so i can fix, iv never distributed my executables before.
I downloaded it and both the map editor and engine ran fine.
I'll make your software hardware.
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: Questions about loading maps and check out my new project!

Post by avansc »

runs in osx under wine, was not expecting that. the level editor is to cryptic tho.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
mv2112
Chaos Rift Junior
Chaos Rift Junior
Posts: 240
Joined: Sat Feb 20, 2010 4:15 am
Current Project: Java Tower Defence Game
Favorite Gaming Platforms: N64/Xbox 360/PC/GameCube
Programming Language of Choice: C/++, Java
Location: /usr/home/mv2112
Contact:

Re: Questions about loading maps and check out my new project!

Post by mv2112 »

avansc wrote:runs in osx under wine, was not expecting that. the level editor is to cryptic tho.
I plan on making it more "User-Friendly" later on, right now though, it just works lol :lol: .
User avatar
mv2112
Chaos Rift Junior
Chaos Rift Junior
Posts: 240
Joined: Sat Feb 20, 2010 4:15 am
Current Project: Java Tower Defence Game
Favorite Gaming Platforms: N64/Xbox 360/PC/GameCube
Programming Language of Choice: C/++, Java
Location: /usr/home/mv2112
Contact:

Re: Questions about loading maps and check out my new project!

Post by mv2112 »

short wrote:http://www.wisdom-soft.com/products/aut ... r_free.htm

honestly I see lots of projects that say "HEY, DL MY .EXE KKTHX"

the above program will allow you to make a basic video of your project and youtube will host it for free. Just sayin

edit: I can't vouch for the program I linked, but I use it and don't believe there are any hidden surprises :)
I'll have to try that, everytime i try and use hypercam or camstudio, the quality is TRASH.
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: Questions about loading maps and check out my new project!

Post by LeonBlade »

avansc wrote:runs in osx under wine, was not expecting that. the level editor is to cryptic tho.
Gah, I can't get it to work...
There's no place like ~/
User avatar
mv2112
Chaos Rift Junior
Chaos Rift Junior
Posts: 240
Joined: Sat Feb 20, 2010 4:15 am
Current Project: Java Tower Defence Game
Favorite Gaming Platforms: N64/Xbox 360/PC/GameCube
Programming Language of Choice: C/++, Java
Location: /usr/home/mv2112
Contact:

Re: Questions about loading maps and check out my new project!

Post by mv2112 »

short wrote:http://www.wisdom-soft.com/products/aut ... r_free.htm

honestly I see lots of projects that say "HEY, DL MY .EXE KKTHX"

the above program will allow you to make a basic video of your project and youtube will host it for free. Just sayin

edit: I can't vouch for the program I linked, but I use it and don't believe there are any hidden surprises :)
Okay, lets say for the sake of argument that someone was told he should make videos and post on youtube :roll: . Now, lets say he actually might do that but he has a problem, he doesnt know what music to play in the background because he doesnt have a mic. What songs would you recommend that person putting in the video? Just for the sake of argument...
User avatar
Maevik
Chaos Rift Junior
Chaos Rift Junior
Posts: 230
Joined: Mon Mar 02, 2009 3:22 pm
Current Project: www.keedepictions.com/Pewpew/
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: Long Beach, CA

Re: Questions about loading maps and check out my new project!

Post by Maevik »

Works great for me! Runs smooth, did not encounter any bugs.

Couple suggestions: It's very easy to get lost in the tile map, making it difficult to know what tiles are adjacent to the selected tile or where to find tiles similar to the selected tile. Maybe you could add a function that shows the entire tilesheet with the selected tile highlighted while SOMEKEY is pressed down.

Also, it would be better to have your tile navigation algorithm limit the user from being able to go off the tilesheet (getting the black tile.) It's always best to prevent an undesirable condition.

Great work! Keep it up!
My love is like a Haddoken, it's downright fierce!
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: Questions about loading maps and check out my new project!

Post by GroundUpEngine »

Just tryed ya Engine, works good. You might want to implement placing the Tile with your mouse once you find a nicer way to load maps ;)
Nice work, great stuff!
User avatar
mv2112
Chaos Rift Junior
Chaos Rift Junior
Posts: 240
Joined: Sat Feb 20, 2010 4:15 am
Current Project: Java Tower Defence Game
Favorite Gaming Platforms: N64/Xbox 360/PC/GameCube
Programming Language of Choice: C/++, Java
Location: /usr/home/mv2112
Contact:

Re: Questions about loading maps and check out my new project!

Post by mv2112 »

GroundUpEngine wrote:Just tryed ya Engine, works good. You might want to implement placing the Tile with your mouse once you find a nicer way to load maps ;)
Nice work, great stuff!
I haven't quit figured out how i am going to get the mouse to work right, the map editor and engine don't use grids for the maps so it'll be hard lol. :mrgreen:
User avatar
mv2112
Chaos Rift Junior
Chaos Rift Junior
Posts: 240
Joined: Sat Feb 20, 2010 4:15 am
Current Project: Java Tower Defence Game
Favorite Gaming Platforms: N64/Xbox 360/PC/GameCube
Programming Language of Choice: C/++, Java
Location: /usr/home/mv2112
Contact:

Re: Questions about loading maps and check out my new project!

Post by mv2112 »

Maevik wrote:Works great for me! Runs smooth, did not encounter any bugs.

Couple suggestions: It's very easy to get lost in the tile map, making it difficult to know what tiles are adjacent to the selected tile or where to find tiles similar to the selected tile. Maybe you could add a function that shows the entire tilesheet with the selected tile highlighted while SOMEKEY is pressed down.

Also, it would be better to have your tile navigation algorithm limit the user from being able to go off the tilesheet (getting the black tile.) It's always best to prevent an undesirable condition.

Great work! Keep it up!
Did you download the version with the pressing 1,2,3, and 4 to switch tiles? I uploaded a new version to my site that fixes this problem by displaying the tile sheet and letting the user click on what tile they want.

EDIT: I forgot i linked directly to the file and not the site lol, i fix now
User avatar
Maevik
Chaos Rift Junior
Chaos Rift Junior
Posts: 230
Joined: Mon Mar 02, 2009 3:22 pm
Current Project: www.keedepictions.com/Pewpew/
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: Long Beach, CA

Re: Questions about loading maps and check out my new project!

Post by Maevik »

Yeah, I was using the 1, 2, 3, 4 version. I'll have to check the newer one out later though since the wife is craving some attention :P
My love is like a Haddoken, it's downright fierce!
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: Questions about loading maps and check out my new project!

Post by MrDeathNote »

Looks nice man, keep it up :mrgreen:
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
Post Reply