Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / A Dark RPG - Errors

Author
Message
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 05:20
Not that I expect a battle system worthy of even the first two Final Fantasy's. I just meant we're both particular about it. I really want to put it together well from the start ( the structure, that is ).
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 05:22 Edited at: 27th Jun 2008 05:56
i wrote an extensive collision function to get exactly what i wanted out of my tile-based system.

It returns true only if the character is facing the obstacle, and not just brushing past it.



this is a member function of character, and inherently player. parameter iDir is the direction, being 0, 1, 2, 3, or up, right, down, left, respectively. sprites with IDs between 200 and 300 are presumed to be obstacles.

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 05:25
It looks complex. I'm not going to read through all of it, but it looks good. My tile system is only at the point of saving tile maps and loading them and drawing them at the specified X, Y. Not very far, but far enough for now. Once I start the character drawing and control, I'll see what I can write up.
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 05:27
show me your tile-drawing function(s).

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 05:28
Alright. Give me a second to piece them together well.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 05:33
Here's the main Map class:



Then, the definitions of some:





And the saving function:



Also, as a note, this tile map isn't meant to hold NPC data and door data. It's meant for the ground and nothing else. I'm going to handle the NPC's differently. At least, that's the plan. It may end up holding NPC data in the end.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 05:35
I know it's not commented yet, but I hope it is clearly written.
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 05:37
what exactly does your saving function save?

i didn't write a class for my tiles, rather, the tiles' sprite ID determines what characteristics they have:
Walkable,
Obstacle,
Teleporter,
etc

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 05:38
Yeah. I hoped to do similar. I'm going to use the solid variable in the struct for collision, but use the type variable for the other attributes ( such as certain tiles inflicting damage ).
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 05:39
It saves the vector of sTile's.
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 05:41
why do you need to save the vector?

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 05:45
I'm loading the maps from files. I have a basic editor started. Not very workable yet, but a start. Here's the start of it. Choose s at the beginning to make a new file. Use space to save to the specified file name.

Attachments

Login to view attachments
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 05:49
i'll take a better look at it later.

just thinking of how i'm going to code the character interaction...

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 05:51 Edited at: 27th Jun 2008 05:52
I think the best ( and probably most obvious ) way would be to add a function to your main loop. Each frame, check for input from whichever key you choose to be the interact key. If pressed, it then checks for an NPC within a certain range in front of the character. If there is one, then start a conversation, or something.
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 05:54
yeah, yeah... trying to find the perfect place to put it though...

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 05:57 Edited at: 27th Jun 2008 05:57
How about here?

elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 06:06
ah, so you understand the player "master" function.

seems like a great place

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 06:06
Awesome!
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 06:43
got any idea what the scancode for spacebar is?

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 06:46
dbSpaceKey ( )

elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 08:08
figured there was one of those.

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 08:10 Edited at: 27th Jun 2008 08:10
Yeah. Wish they had more. Like, one for each letter. But, you know how they are ( programmers, not TGC ).
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 27th Jun 2008 08:25
Modular design, you mean?

Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 08:31
Actually, I thought of the work modular just after using compartmentalized. I like it. It's how they describe CryENGINE 2.
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 10:25
modular...

hmmmmm

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 10:26
Brainstorm. For NPC's and doors and such, I can strip down the map class I posted and make a tile map class derived from it. Then, I can make derived classes for maps to hold the other type of data. Good idea, or sucky 2-in-the-morning idea?
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 10:33
i say, start back from how you're going to calculate collision.

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 10:34
Just an idea for later on. I've not gotten to that yet. I haven't worked on it much lately.
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 11:27
the most simple interaction in my game would be a quick dialogue.

i'm working on that atm

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 12:10
If you get anywhere, be sure to update me on your progress. I'm going to bed, though.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 28th Jun 2008 07:15
Little quote for you all:

To err is human, but to really foul things up requires a computer.
-Farmers' Almanac
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 28th Jun 2008 16:37
Quote: "To err is human, but to really foul things up requires a computer."


I used to have a little plaque on my desk that said that, just so people entering my office would know what they were getting into.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 28th Jun 2008 18:27


I want one!
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 1st Jul 2008 08:15
Link for you. Haven't gotten the chance to go over these well, but they look very helpful for tile-based work:

http://www.gamedev.net/reference/list.asp?categoryid=44

I hope you find it useful.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 4th Jul 2008 00:05
@elantzb

I don't know if you've been working on your game lately, but I've been working on playing a lot of the classic RPG's, especially tile-based classics. I figured that, aside from hours of fun, it would help my perspective of what an old-school RPG should be.

Some that I've played ( recently and years ago ) are:

Dragon Warrior I & II ( Classics. Beat I when I was 8. )

Dragon Quest VIII ( Quite difficult. )

Final Fantasy III ( DS remake. Amazing game. Very much old-school RPG style. )

Final Fantasy V ( GBA remake. Don't care for ATB. )

Final Fantasy X ( Very good for people new to Final Fantasy games. )

I know this seems a little off topic, but I think that playing these games really gives you some inspiration.
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 4th Jul 2008 09:02
keep in mind, the zelda series very possibly could have used tilesets as well.

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 4th Jul 2008 09:05 Edited at: 4th Jul 2008 09:06
I know. Just haven't played those in forever. Never cared too much for them, either.

I was just mentioning my recent "endeavors." I was also curious what you thought of it.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 03:59 Edited at: 10th Jul 2008 04:02
Well, I've been working on the game some more. I've not been able to that much due to some problems my family's had lately.

But, I've made some progress. I have the start of the program structure and a basic message box class that I'm about to add text-capabilities to. Here's Main.cpp



The overworld mode will soon change to "main_game", with divisions including overworld.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 04:01
Oh, and, at the moment, the main_menu mode displays the attached image. It's a bare message box that I will add an actual menu to once I'm finished with the text and control functions.

Attachments

Login to view attachments
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 10th Jul 2008 05:52
looks good. my project might be on hold until august, as i'm away from home.

but keep me updated. i'm curious to see your message box code.

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 06:20
No problem. It's drawn with primitives and organized within a class. I made it simple to make different styles and sizes. But, I haven't added comments yet, so, I hope it's clear. I'm going to add those once I get a more concrete setup. This is, of course, without text support. Simply boxes.

GUI.h


GUI.cpp
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 06:23
I'll update you on any further improvements. I should have ample time over the next day or two. Sorry you're unable to work on yours. Can't wait to see what you do when you can!
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 06:37 Edited at: 10th Jul 2008 06:38
Sorry, I forgot to post this to show it's usage. It's the code for the main menu message box I posted the pic of.

SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 07:34 Edited at: 10th Jul 2008 07:36
I wrote a 'simple' window system designed for maximum control by the programmer, at minimal cost in repetitive code. A (draggable within the GDK app's window, mind you) window with a few buttons works something like this:

(Some of the fat can be trimmed from this code, in that it draws the buttons when the window is being dragged, which is theoretically unnecessary, the system for handling buttons could be better integrated to the generic button function, etc.)

I don't know if it worked out to be all that simple, but it's fast. Anyway, the idea is that with a little effort, you can get a solid system to present consistent menus to the users of your game. The worst software design comes from inconsistency in the control systems, of course.


My site, for various stuff that I make.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 07:38
What includes are needed to run that?
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 07:41 Edited at: 10th Jul 2008 07:43
A short header I wrote, plus globstruct.h and windows.h.

The header, mapi.h, looks like this:

Note that this header has a few other functions, that aren't used in my little example. My apologies that it isn't commented, I never bother with that. You're welcome to use any of that if you can make sense of it.


My site, for various stuff that I make.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 07:53 Edited at: 10th Jul 2008 07:59
I had to comment out a few commands, but it worked. Very nice. I had to rearrange the code to understand it. Sorry, I'm just picky.

SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 07:58
That much organization is a bit too much for me. I prefer as compact as possible, retaining readability. The commands you had to comment reference the actual game-y parts of the program, which don't fit so nicely into the example. (Quite a bit more code!)


My site, for various stuff that I make.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 10th Jul 2008 08:01
Yeah. It's preference. But, I'm OCD, so, I like things organized.

It works great, though. Can't say I understand it, though. I'd have to look over it more. I don't know the Win32API.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 10th Jul 2008 08:16
As I recall, the only thing it does with globstruct.h is get the handle for the DarkGDK window using g_pGlob->hWnd, and the only thing it uses windows.h for is the MessageBox() function.

Everything is 'normal' C++ with DarkGDK.


My site, for various stuff that I make.

Login to post a reply

Server time is: 2024-09-30 03:22:02
Your offset time is: 2024-09-30 03:22:02