HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.
Pages: [1] 2

Author Topic: [Resolved] Scripting a combat system  (Read 5693 times)

Asserna

  • World Owners
  • ****
  • Posts: 6
    • View Profile
[Resolved] Scripting a combat system
« on: Sep 24, 13, 09:03:57 AM »

So I've been peering at the combat system that is already in HE.

I've identified the scripts ab_fireball to have something to do with it.

If I change the damage, the new damage only works for a short time. I'm guessing the game is overriding the new file that doesnt concurr with the original.

So, to my questions.

How do i go about scripting my own... actions/attacks etc?

I know it is a stupid question, but this is what i'm interested in, and I havn't found any previous thread on the matter.

Thank you in advance.
« Last Edit: Nov 04, 13, 07:03:12 PM by HE-Cooper »
Logged

WorldWideZ

  • World Owners
  • ****
  • Posts: 524
    • View Profile
    • World Wide Zed
Re: Scripting a combat system
« Reply #1 on: Sep 24, 13, 09:14:27 AM »

The example scripts are not updated , if you change them it should persist , so im not sure why your damage would not stay at its new value

the ability is one piece in the overall system , to map the system out ,start off by finding what calls the ability , and what calls that etc , until you have a complete picture of the systems involved. Once you have a good idea of how it works , start by overriding a class and then experiment on your version , this way you can always look at what was there when yours breaks :D   
Logged

Asserna

  • World Owners
  • ****
  • Posts: 6
    • View Profile
Re: Scripting a combat system
« Reply #2 on: Sep 24, 13, 09:24:09 AM »

I'll see what i can dig up/ understand :)
thanks!
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: Scripting a combat system
« Reply #3 on: Sep 24, 13, 10:47:42 AM »

I wouldn't use the built in system it's only a temp setup that has a bunch of manageability issues.

Look at the spec editor / data storage tutorial. it covers the start of making an ability system using the spec system.

The spec system is a great place to put a system of abilities, etc. Most abilities will have a bunch of immutable data, but when applied to the player has fields useful that are mutable. For example the fireball for a level 9 player will have one damage value while a level 40 will have another. Also could have other factors that affect the damage etc. Using something like the spec system gives you a bunch of flexibility in the system while also keeping a good amount of static (immutable) data which keeps the system efficient.

Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

Thazager

  • General Accounts
  • *
  • Posts: 1160
  • Never stop learning
    • View Profile
Re: Scripting a combat system
« Reply #4 on: Sep 24, 13, 07:57:17 PM »

Besides the abilities being on the client side, they are duplicated on the server side. This is to ensure they can be accessed just as fast from each side without need of sending data from client to server and back again.
Logged
Lead scripter for EO, Repop helper.
HSL Video tutorials:
https://community.heroengine.com/forums/index.php/topic,1719.msg36858.html#msg3685

Tarra2012

  • General Accounts
  • *
  • Posts: 113
    • View Profile
Re: Scripting a combat system
« Reply #5 on: Sep 24, 13, 09:03:14 PM »

I wouldnt recommend the spec system first.
Try to follow the call chain (like worldwidez proposed).

Normally your changes should persist. If not, look if your versioning (p4merge wiki) is installed correctly.

Why not Spec?
You are beginning to learn. The Spec System in HeroEngine is quite advanced. It will take weeks until you set it up and use it correctly. If not even more time. There are other parts to focus on first in my opinion.

Better go for understanding the given Engine structure of "classes" and "methods".
Specially the connection between "client" methods that call "server" methods  and vice versa.

Try to make one new ability in Hotbar (with the connected changes in many classmethods).
Once you got that, you know how the HE Team designed the dummy combat system.





Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: Scripting a combat system
« Reply #6 on: Sep 24, 13, 09:25:15 PM »

so waste time, messing with a system that teaches you bad habits, cause it's easier?

The spec system is actually really easy, to manage and work with. The only hard part is understanding the base principles of how to build efficient systems. which has nothing to do with the spec system. The spec system just provides the tools to do it.

Now I get it if you are new to coding and need to get your feet wet, then yes doing easier things is a great way to start, but I don't want to see him spend time and energy learning how it is setup in default and then think it's the way to go and building a huge very unmanageable combat system based off of it.

Just was saying feel free to play around with how it works, (the default) etc and see what does what and how it happens etc, but from there learn that your are better off picking up the spec system. He has to learn it sooner or later and the sooner he learns it the better he will be. The spec system is the bread and butter of HeroEngine, it's going to be play a role in nearly every system you build out to some level or degree, so you should just get use to it as soon as possible.



Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

WorldWideZ

  • World Owners
  • ****
  • Posts: 524
    • View Profile
    • World Wide Zed
Re: Scripting a combat system
« Reply #7 on: Sep 25, 13, 12:46:54 AM »

the spec system is one way of doing things , but its not always the best solution for a team to use.

personally i tried to start at the spec system , found it left me confused and no further into understanding how to start working on the engine. Not saying i might not come back to use it later , but their are ways of mimicking the spec  oracles that dont need hotspot rebuilds and the like. 


Logged

Tarra2012

  • General Accounts
  • *
  • Posts: 113
    • View Profile
Re: Scripting a combat system
« Reply #8 on: Sep 25, 13, 04:40:04 AM »

@keeper:
You gave the answer yourself. For stepping into HE the Spec-System is not the easiest part. It will leave you on dry ground for a while. I would advise everybody to learn other basics first. Gui, Events, Call-Chains, Input Handling, Observer/Listener, Node reflection, Replication vs Rpc, Timer, Prototypes...

Spec Complexity is high: I posted several question around Specs and got spare replies in forum.
I truely believe we have only few people (community) who are really in depth familiar with pros and cons from the system and are giving their opinion. Most clearing usually comes from he teammembers.

I would still say the other Storage choices have their rights to be used as well.
( Script Data, Repository data, Prototype data see: http://hewiki.heroengine.com/wiki/Data_storage_options).
Especially if you watch synchronous vs asynchronous aspects, or the easy of use.

@asserna:
Ab_ scripts server/client hold most of the logic around abilities.
Watch out for a method GetAbilityGrants(). The "list" needs to be updated client/server as well when you introduce new scripts.

e_nonplayercharacter/e_playercharacter

method GetAbilityGrants() as List of ScriptRef
  abilityGrants as List of ScriptRef
  add back abSwipe to abilityGrants
  add back abRubyFire to abilityGrants
  return abilityGrants
.

« Last Edit: Sep 25, 13, 04:54:07 AM by Tarra2012 »
Logged

AWW_boss

  • General Accounts
  • *
  • Posts: 846
  • gdfgd
    • View Profile
Re: Scripting a combat system
« Reply #9 on: Sep 25, 13, 05:40:19 AM »

I agree that specs can be overwhelming to a new user, but once you get used to them, they're easy to understand.

I suggest that first you should try doing everything without specs. Eventually you'll come to the point where you'll think "I should have used specs for this". But it will be a great learning process.

That's how it vent for me... but i am glad, because without it, I wouldn't be able to appreciate the benefits of the system. Everyone should go the same road as me while they're learning.
« Last Edit: Sep 25, 13, 05:42:29 AM by AWW_boss »
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: Scripting a combat system
« Reply #10 on: Sep 25, 13, 07:24:18 AM »

The spec system takes about 10 hours of watching a set of videos.

The wiki explanation of the spec system is brutally terrible compared to how simple the system actually is. Only challenging part at all is building custom spec interfaces, which isn't all that hard just have to know your GUI stuff, and how the data types work.

What people find hard about the spec system has nothing to do with the spec system, it's about making effective / efficient systems. Or having good system designs.

A comparison outside of HE, is when the whole model view client or MVC structure for code writing came out. People flipped went into panic and kicked and whinned about going down that route. After they got over the fear they refused to give it up.

Also here is my take on the  get your feet wet or not deal. if he is just wanting to make a new ability, change an icon up, and get the base player to play the flip jump animation when doing the attack, ok. Problem is even that is a 30 step process, envolving ever system in the game. Have to know how to call animations, how to call FX, how to code playing an FX, how to make a particle system, how to alter gui, etc. I get where he is coming from though, make something different get a good feeling you added an attack that wasn't there. I welcome this get your feet wet deal, and it does touch on almost all the systems.

 I just wanted to point out though, while he was digging around and playing with this said code. To not get too accustomed to it and not to start building his go live combat setup around it. Just play around and get use to things sure, but often times people see a template and start to think that is how to do it, and the built in system is far from an effective system at all. It's completely unmanageable at scale and extremely difficult to adjust or make efficient. know why I know this? Cause just like him I looked at it, and played around with it, made the heal kill you instead of heal, added a recall ability to the bar etc. At one point I even thought hmmm ok this isn't bad I could make this work. Then I realized no, I couldn't doesn't support enough options to be viable for any ability system, is very hard to maintain, and would always require a coder to make any balance adjustments. Not to mention a nightmare on node management between classes, aka a ranger's abilities vs warrior. etc. It just refused to scale worth a darn. Just wanted to give him a heads up there is a much better option.


Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

Asserna

  • World Owners
  • ****
  • Posts: 6
    • View Profile
Re: Scripting a combat system
« Reply #11 on: Sep 25, 13, 08:06:49 AM »

I appreciate your heads up keeperofstars.

I'm currently reading up on the spec system, but I guess I really need to get in there and start creating to stuff to understand how it works.

And more importantly... how to use it without my brain rupturing :3

Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: Scripting a combat system
« Reply #12 on: Sep 25, 13, 11:21:55 AM »

lol that will be your life for the next 3 to 5 years.

If you need any help with the spec system just let me know, once the light blub hits you will go ohhhhh, that is so simple.

To see the spec system in work, just hit the f5 tool, and look at the chat system, lobby system, state system, fx system, npc character system, etc they are all spec systems. :)

If you just want to get your feet wet, I really suggest working through the wiki tutorials and the dev tutorials. Something like the combat system in any game is a huge undertaking, as well lets face it accounts for about 60% of all of your game. Everything else is just there to support that main aspect.

The camera system is also a good one to play with, as it covers a bunch of things, but is overall really simple to follow.

Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]

Gassy_the_Goblin

  • World Owners
  • ****
  • Posts: 20
    • View Profile
    • joshpurple.com
Re: Scripting a combat system
« Reply #13 on: Oct 08, 13, 04:57:15 PM »

Great thread, -makes me realize how much I don't know  :) , BUT it's a huge help in understanding & approaching the learning path(s) with the Hero Engine.

Learning the character creation / NPCs / Movement, etc. has gone very well, Thank You Keeper of Stars & World Wide Z !  I have been able to successfully create non-biped NPCs (and bipeds); running around, jumping, etc. -all sorts of animations (no problem with HE & 3ds Max, Biped, CAT, etc. -all working great), understanding the basic script for it (even somewhat understanding the Hero's Journey's Standard, Biped Agent .AAS script.  Keeper of Stars made that MUCH easier to learn  ;D ).

I'm behind Asserna's level of understanding with the combat system in HE, but I am hoping to get there, where I'm a bit stuck at attempting to learn/understand the Character Creation System from the Wiki page (http://hewiki.heroengine.com/wiki/$CHARACTERCREATIONSYSTEM).

I've started watching the "HeroEngine Data Storage Tutorials,"  -excellent & very needed learning.  Although there are parts that go over my head, where I'm wondering what direction / where I might look for learning/understanding the CCS better and getting into the combat system?

Thanks in advance for any suggestions or help, -and I really appreciate the community here on the forums .
Logged

keeperofstars

  • General Accounts
  • *
  • Posts: 998
    • View Profile
    • StarKeeper Online
Re: Scripting a combat system
« Reply #14 on: Oct 08, 13, 06:59:44 PM »

well is there something special with the character selection you want to do? Show the player model or change the default look and feel etc?

possible tutorial to follow would be there it shows how to change up the gui some.
https://community.heroengine.com/forums/index.php/topic,4442.0.html

If you looking to do more like have the area changed to a more populated one you can do so etc, fairly easily just need to have a better idea of your general goal.

In regards to combat system, it really depends on what type of combat system you looking to make. Point and click, more FPS based, you doing ground targeting? doing projectiles are they always hit or "moving" objects etc.

I ask cause it kinda changes the direction you need to look at things, in general though all of them will utilize the spec system. Which is nothing more than a highly effective templating system. Cause players will commonly share abilities, so you want to use a template for those abilities. aka the basic information for the fireball ability will be the same for every single player, so you want to store that information in 1 unit or template, to be constantly looked up and used, instead of having every player with a unique copy this saves a ton of resources. Then you just have the added parts that aren't part of that template lets say user damage mod cause they have a higher skill level, or such. That data will be unique for each player.

Logged
[img]http://screencast.com/t/x7btcSSyp3h0[\img]
Pages: [1] 2