HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Opinion on GUI Exp System

01-30-2009, 03:56 PM#1
Sgt_Johnson
I've tried to come up with my own GUI Exp system and I'm trying to get opinions on how it looks, currently it's for an RPG I have been working on off and on for the last year or two and now I'm going to finish it since I finally got a working Save/Load implemented.

Basically how the system works is increasing the Exp rate depending on how many other players are nearby, encouraging teamplay.

The Exp rate is low while solo, if a 2nd player is near your hero the exp rate is doubled. Even though the Exp both heroes will gain will be around the same as if they were solo they will be killing creeps at a faster rate and thus gain more Exp.

It's pretty simple but I think it works perfectly fine :)

Trigger:
EXP Rate
Collapse Events
Time - Every 5.00 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to (==) True)) and do (Actions)
Collapse Loop - Actions
Hero - Make (Owner of (Picked unit)) Heroes gain (30.00 x (Real((Number of units in (Units within 600.00 of (Position of (Picked unit)) matching ((((Matching unit) is A Hero) Equal to (==) True) and (((Matching unit) belongs to an ally of (Owner of (Picked unit))) Equal to (==) True)))))))% experience from future kills

The only heroes in the map are player controlled, so theres no huge abundance of heroes this trigger would affect.

Also for the dungeons/rare creeps/outdoor bosses/ect. there is another function that grants bonus Exp to the killing heroes for each other hero nearby, depending on the creeps level.

Trigger:
Hero - Add (((Level of (Dying unit)) x 5) x (Number of units in (Units within 750.00 of (Position of (Dying unit)) matching (((Matching unit) is A Hero) Equal to (==) True)))) experience to (Dying unit), Show level-up graphics

Opinions? Or ways to improve it?
01-30-2009, 04:21 PM#2
chobibo
I think the idea is great :D. Code-wise it doesn't look very good (it has leaks), sorry if I can't give any recommendations, I didn't learn GUI very much.
01-30-2009, 04:26 PM#3
Veev
The only thing I would say to change is to make a unit group variable for the Heroes. Whenever a Hero is summoned or whatever, just add them to the group and instead of using "Pick all Units in Playable Map Area" you just have "Pick all Units in SomeUnitGroupVariable". That's just a personal preference of mine and what you have now is clearly fine.

Or maybe it leaks a group. Not sure... So maybe it is best to use that Unit Group variable.
01-30-2009, 04:38 PM#4
Sgt_Johnson
Kk added the players hero to a Unit Group

Trigger:
EXP Rate
Collapse Events
Time - Every 5.00 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in PlayerHeroes and do (Actions)
Collapse Loop - Actions
Hero - Make (Owner of (Picked unit)) Heroes gain (30.00 x (Real((Number of units in (Units within 600.00 of (Position of (Picked unit)) matching ((((Matching unit) is A Hero) Equal to (==) True) and (((Matching unit) belongs to an ally of (Owner of (Picked unit))) Equal to (==) True)))))))% experience from future kills

What would be a better alternative for the event rather than every 5 seconds, I'm thinking of a Unit comes within Range event but I'm not sure =/
01-30-2009, 04:45 PM#5
Veev
I was thinking that, too. I don't know if that's really necessary because a periodic timer every 5 seconds is not taxing or anything, especially doing what you have. Using "Unit comes within Range" event is more accurate especially if heroes are moving in and out of the radius frequently. Although, you could probably get away with decreasing the periodic time down to 1 or 2 seconds. This would minimize the amount of time a hero doesn't get bonus xp when it should.

I mean, I'm not too sure, though. You'd have to see if changing this particular periodic timer has any effect to your gameplay. If you change it down to 1 second and you notice some lag while using some spells when it didn't lag when using 5 seconds, maybe you should just increase it to 2 seconds.
01-30-2009, 04:56 PM#6
Sgt_Johnson
Alright, well hopefully this works fine, now I just gotta get the new respawn system working.

The previous one worked but it went off spawning the unit where the previous one died, wanted to fix that but I can't seem to get it to work ><