AGS: Can I Make an RPG with AGS?

Started by TerranRich, Mon 03/05/2004 05:56:47

Previous topic - Next topic

charliechuck

Would anyone be interested in looking at the source code to Winterlong? Again it's similar to Final fantasy style combat. I've not touched it in years, I think it was written in AGS 2.72? If anyone is interested let me know which files to upload.

jocke the beast

Please do so. I would love to learn a bit from it.
Thanks!

charliechuck

It's here

http://donspillacy.googlepages.com/ac2game.ags if anyone fanices a look.

I think that's the only file you need to be able to see the code. The fights take place in room 2, so most of the code is there. I'm not sure if this will be much use to anyone or not probably not. It's not the cleanest written code and there's no instructions, it's been so long since I did it I wouldn't have a clue what bit does what anymore.

HintBook user

I'm making an RPG with health and stamina bars (using the DrawRectangle function), similar to the ones in Quest for Glory.

The problem is that the character will level up, and their maximum amount of health and stamina will change, but I want the bars to stay the same length.

I tried writing the DrawRectangle function like this:
a_hp.DrawRectangle(0, 0, ((Aaron_health/Aaron_health_max)*80)-1, 4);

It works fine for Aaron's health, but not for the other bars.

Anybody know what I'm doing wrong?

monkey0506

Your code looks fine, what does the code for the other character's meters look like?

By the way, you can use [code] and [/code] to encapsulate your code like this:

Code: ags
a_hp.DrawRectangle(0, 0, ((Aaron_health/Aaron_health_max)*80)-1, 4);


Makes it a bit more readable here in the forums, and prevents any issues with formatting (such as 8 followed by a parenthesis resulting in 8)). ;)

Welcome to the forums as well.

HintBook user

Thanks for the welcome.

Here is the code for the other meters.

Code: ags
a_sp.DrawRectangle(0, 0, ((Aaron_stamina/Aaron_stamina_max)*80)-1, 4);

e_hp.DrawRectangle(0, 0, ((Enemy_health/Enemy_health_max)*80)-1, 4);

e_sp.DrawRectangle(0, 0, ((Enemy_stamina/Enemy_stamina_max)*80)-1, 4);


I basically copied and pasted the function for Aaron's health and changed the words around, so I'm not sure if this explains anything.

monkey0506

Okay, again the code looks fine. Now then, what is actually happening?

One thing here I can think of is that perhaps you're not calling DrawingSurface.Clear on your surfaces before trying to draw the rectangle? Because obviously if you keep drawing them on top of each other in the same color you wouldn't see the changes (unless it was increasing of course).

Other than that where are the variables being updated at? Are you certain the values are what you think they are?

Where are you calling this code? Is it in the same place as the first code?

If all else fails you could always use some breakpoints to make sure that the lines are being called and some Display-s to make sure that the variables are the values you expect (such as):

Code: ags
Display("Aaron's stamina: %d", Aaron_stamina);

HintBook user

What happens is that when Aaron_stamina is equal to Aaron_stamina_max, it fills the bar normally, but if Aaron_stamina is any less than Aaron_stamina_max, the rectangle shows as only one pixel wide.

All of the lines of code are part of seperate functions, which are called whenever their value is changed.

Just to check, I put in displays showing what the values changed to, and they are correct.

Khris

With ints, if a is less than b, a/b is always 0.
You need to use

Code: ags
  if (Aaron_health > 0) a_hp.DrawRectangle(0, 0, ((Aaron_health*80)/Aaron_health_max)-1, 4);

HintBook user


monkey0506

Quote from: KhrisMUC on Fri 28/08/2009 08:03:59With ints, if a is less than b, a/b is always 0.

D'oh! I should've caught that...of course.

darkwolfe

It seems most of the info concerns turn-based rpgs, but can a Legend of Zelda-style game be made--basically, something with real-time combat?

RPGMaker also seems to be intended for turn-based combat. If AGS isn't suited for a game of this type, I'd appreciate if someone can point me to a suitable engine that can be used commercially (thus, I'm not interested in the Zelda Classic/ZQuest engine).


Khris

A suitable alternative would be GameMaker, but in theory, a (SNES) Zelda clone is perfectly possible to create with AGS.
You'd have to do a lot of scripting though since you can't really use much of the built in functionality. There's a TileEngine by abstauber that should diminish the workload a bit.

.M.M.

Quote from: darkwolfe on Thu 03/06/2010 09:33:59
It seems most of the info concerns turn-based rpgs, but can a Legend of Zelda-style game be made--basically, something with real-time combat?

Yes, it is possible and even not too hard to create. If you want to do a game with real-time combat, I think it´s easier to do normal and combat rooms.

Lufia

It might be easier to script your A-RPG engine in RPG Maker, actually. The base architecture of the project will be more adapted to an RPG and you can do whatever you want with Ruby. I've even seen passable A-RPGs done exclusively with event programming in RPG Maker.

Enterbrain also released Indie Game Maker, which is designed for platformers, shmups and A-RPGs.

Matagot

#295
How possible or difficult is it to design retro first person view style RPGs such as Eye of the Beholder, Dungeon Master, Wax Works, Black Crypt, etc with AGS where you click on arrows to guide your party of characters through mazes and fight wandering monsters?


Khris

Very possible, there is a game like that in the works, I can't find the thread right now though.

Basically, all level info is stored in a grid, and the first person-view is generated by iterating through that grid from far to near, drawing pre-made walls.
I'd say the scripting involved is semi-complex. You'll need AI that moves monsters around and some short of shop system, I guess.

It all comes down to organizing a buttload of data well enough to not pull your hairs out continuously during coding :)

(In general, there's pretty much no limit as to what type of game can be created with AGS, except speed.)

Matagot

Quote from: Khris on Tue 07/02/2012 14:47:27
Very possible, there is a game like that in the works, I can't find the thread right now though.

Basically, all level info is stored in a grid, and the first person-view is generated by iterating through that grid from far to near, drawing pre-made walls.
I'd say the scripting involved is semi-complex. You'll need AI that moves monsters around and some short of shop system, I guess.

It all comes down to organizing a buttload of data well enough to not pull your hairs out continuously during coding :)

(In general, there's pretty much no limit as to what type of game can be created with AGS, except speed.)

Brilliant! Please let me know via PM of any related threads or advice/codes/grid info on how to make such an RPG.

;D

.M.M.

Eye of the Tempest is what you migt be interested in, but it looks like it was cancelled long time ago.

DBoyWheeler

Concerning the RPG with AGS... someday I may want to do something Quest for Glory style.  I can find the Day/Night tutorial thread and the Hunger tutorial thread (and I'd probably do it in the style of the first four QG games where the hero would eat automatically if he had rations), and perhaps other things I can try to search for or ask for if needed, but I thought I'd ask this out of curiosity...

For some of these ideas, I'd probably need more than the 200 save state rooms alloted, so... I'm just guessing this, but for the non-save-state rooms, would they be best for the "overworld" areas?  I'm also guessing you'd need global variables to check if a monster is chasing you or not, and how many screens you'd have to run before the monster loses interest in you and leaves you alone.  If my guess is incorrect, feel free to correct me on this.

SMF spam blocked by CleanTalk