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

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:
GroundUpEngine wrote:Hmm, well if it works without the dll, then it must be statically linked by default. btw I'm just guessing ;)

p.s. I prefer to statically link as many libraries I use as possible, so my program's directory isn't full with dll's however the file size is always alot larger.
in windows the exe will look for libraries in 2 places, unless otherwise specified in the code. first it will look in the local directory, then in system32 or whatever its called these days. id first go look to see if the dll is not in that directory either.
I looked in system32 and the project directory, no lua dlls
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 »

User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

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

Post by eatcomics »

LUA!!!!!!!!!!11111111111111 but fucking rape youtube, then leave it on the corner like a dirty hooker
Image
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 »

eatcomics wrote:LUA!!!!!!!!!!11111111111111 but fucking rape youtube, then leave it on the corner like a dirty hooker
I HATE vector<object*> thingy!!!!!!
THIS IS WHY:

Code: Select all


thingy.push_back(new object);
delete thingy[0];
//DOESNT WORK!!!
I just spent hours trying to figure out why!!!! THIS IS WHY!!!!

Code: Select all

thingy.push_back(new object);
delete thingy[0];
thingy.erase(thingy.begin()+0); //I guess when you delete, it doesn't delete the pointer in the vector!!!!!
Why i am so upset?
My engine IS LOADED WITH VECTORS!!!!!! SPECIFICALLY VECTOR<OBJECT*>THINGY's

Ahh, i feel better now :mrgreen:
User avatar
RyanPridgeon
Chaos Rift Maniac
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: Questions about loading maps and check out my new project!

Post by RyanPridgeon »

Yeah that's the same with all pointers. Don't forget a pointer is just a pointer, the memory it points to is allocated seperately.

Also wow, you don't waste any time. Nice videos keep it up :D
Ryan Pridgeon
C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal
Music | Blog
User avatar
lotios611
Chaos Rift Regular
Chaos Rift Regular
Posts: 160
Joined: Sun Jun 14, 2009 12:05 pm
Current Project: Game engine for the PC, PSP, and maybe more.
Favorite Gaming Platforms: Gameboy Micro
Programming Language of Choice: C++

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

Post by lotios611 »

I'm having trouble running your engine on my computer. It says "Debug Error!" It seems that Allegro can't set the graphics driver.
"Why geeks like computers: unzip, strip, touch, finger, grep, mount, fsck, more, yes, fsck, fsck, fsck, umount, sleep." - Unknown
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 »

lotios611 wrote:I'm having trouble running your engine on my computer. It says "Debug Error!" It seems that Allegro can't set the graphics driver.
:shock:
What's your screen resolution, i'v noticed that if the screen res of your computer is the same as the engine, it crashes cuz it tries to make a windows the same size as the screen. Plus, i haven't upoaded the new engine yet.

Engine res is 1024x768.
To make it smaller, edit the engine.mv file and change 1024 to whatever and 768 to whatever, same with the map editor.
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 »

I just thought i would share another FAIL of mine while deving. :mrgreen:
Ok, so i found a bug in my inventory system. I made a heart that adds health when you use it but you cant use it if you have full heath. When ever i would use it, i would get a memory access error, so i just spent about 5 hours looking through all object pointer to see if i was forgetting to delete one(cuz their in vectors). As it turns out, the reason i was getting the error was this:

Code: Select all


int AddHealth(int h)
{
health+=h; //WRONG!!!
}

I was adding an integer to a POINTER!!!!!!

Code: Select all

*health+=h;
OMFG
:nono:
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

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

Post by eatcomics »

Don't you just hate when you do stuff like that?
Image
K-Bal
ES Beta Backer
ES Beta Backer
Posts: 701
Joined: Sun Mar 15, 2009 3:21 pm
Location: Germany, Aachen
Contact:

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

Post by K-Bal »

Why is health a pointer? :)
User avatar
lotios611
Chaos Rift Regular
Chaos Rift Regular
Posts: 160
Joined: Sun Jun 14, 2009 12:05 pm
Current Project: Game engine for the PC, PSP, and maybe more.
Favorite Gaming Platforms: Gameboy Micro
Programming Language of Choice: C++

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

Post by lotios611 »

mv2112 wrote:
lotios611 wrote:I'm having trouble running your engine on my computer. It says "Debug Error!" It seems that Allegro can't set the graphics driver.
:shock:
What's your screen resolution, i'v noticed that if the screen res of your computer is the same as the engine, it crashes cuz it tries to make a windows the same size as the screen. Plus, i haven't upoaded the new engine yet.

Engine res is 1024x768.
To make it smaller, edit the engine.mv file and change 1024 to whatever and 768 to whatever, same with the map editor.
That was the problem. You might want to put that in the README. The only problem is that it's impossible to see the whole map when you change the resolution. That'll go away once you add tile scrolling (you are going to add that, aren't you?).
"Why geeks like computers: unzip, strip, touch, finger, grep, mount, fsck, more, yes, fsck, fsck, fsck, umount, sleep." - Unknown
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 »

K-Bal wrote:Why is health a pointer? :)
Because of my crappy OO design, to render the health bar, the map has a pointer to it.
lotios611 wrote:
mv2112 wrote:
lotios611 wrote:I'm having trouble running your engine on my computer. It says "Debug Error!" It seems that Allegro can't set the graphics driver.
:shock:
What's your screen resolution, i'v noticed that if the screen res of your computer is the same as the engine, it crashes cuz it tries to make a windows the same size as the screen. Plus, i haven't upoaded the new engine yet.

Engine res is 1024x768.
To make it smaller, edit the engine.mv file and change 1024 to whatever and 768 to whatever, same with the map editor.
That was the problem. You might want to put that in the README. The only problem is that it's impossible to see the whole map when you change the resolution. That'll go away once you add tile scrolling (you are going to add that, aren't you?).
Eventualy :mrgreen:

Im probably going to redesign the item system first because it is HORRIBLE, i randomly get vector subscript out of ranges!
(Maybe even re-structure the entire engine)
My OO design is total garbage.

Does anyone have any tips on good OO design practices?
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 »

mv2112 wrote:Does anyone have any tips on good OO design practices?
Have a skim through this thread, it may help -> http://thechaosrift.com/viewtopic.php?f ... 999#p53934


Also could you describe your Engine structure? So we can see what might need improvement e.g.

Code: Select all

main.cpp // uses instance of engine class to power app/game

class Engine; // handles player & tiles

class Entity; // basic base for renderable's e.g. int x, int y, Init(string filename), Update(), Draw()
class Player : public Entity; // player class
class Tile : public Entity; // tile class
..etc
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:
mv2112 wrote:Does anyone have any tips on good OO design practices?
Have a skim through this thread, it may help -> http://thechaosrift.com/viewtopic.php?f ... 999#p53934


Also could you describe your Engine structure? So we can see what might need improvement e.g.

Code: Select all

main.cpp // uses instance of engine class to power app/game

class Engine; // handles player & tiles

class Entity; // basic base for renderable's e.g. int x, int y, Init(string filename), Update(), Draw()
class Player : public Entity; // player class
class Tile : public Entity; // tile class
..etc
ugh, as im looking through the source code, my engine really has no organized structure, lol, here are the classes:

mvEngine: handles inistializaiton and final rendering(contains buffer)
map: map objects that handles loading the map and blitting to buffer
Sprite: started as a sprite class(hence the name) but ended up being a player class
ObjectController: handles all objects in the game
object: handles the properties of objects
heart:public object: different object
orb:public object: different object
//heart and orb are just test objects
inventory: player's inventory system

I think thats it.

One mistake i made was i had every object contain a pointer to the mvEngine rather than mvEngine contain all instances of classes.
I defiantly am going to restructure the engine and use std::vectors sparingly now.
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 »

Cool structure is important, well sounds like you got it figured out ;)
Post Reply