Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


ncsu121978

Member Since 29 May 2000
Offline Last Active Jul 02 2015 08:10 AM

#5237253 how to program A LOT of skills/spells?

Posted by ncsu121978 on 28 June 2015 - 07:41 AM

Base class with derived skills isnt a terrible idea. But you dont need a class per skill. Group them into similar ones and change them with paramterrs. Examle would be to have a base class of CSkill. Deribe from it say a skill CLaunchProjectile. Now launch projectile can be used for your fireball or your arrow...just change the texture of the actual projectile created.

Also i would not really use a flag system for determining if they have a skill. I would create a list of CSkill and whenever a character earns a new skill add it to the list. Then only allow skills from the list to be used.


#5232876 Simulating Typing in C

Posted by ncsu121978 on 04 June 2015 - 08:21 PM

unless you just want strictly "C" code only, I would highly recommend using std::string and its associated member functions to loop through its characters individually; should be much safer than a raw char*




#5227614 Can't get Lidgren client to connect to local server

Posted by ncsu121978 on 06 May 2015 - 06:45 PM

I am pretty sure the string in the NetPeerConfiguration constructor needed to be the same on the server and client.

you also looking for the ConnectionApproval message on the server.  But by default this message type isn't enabled.




#5192442 prevention of loops in transfer of [consumable] between game entities

Posted by ncsu121978 on 12 November 2014 - 11:34 AM

11huhkn.jpg

Question:  I have energy producers, energy storage, and energy consumers connected together by links as in the picture.  I can have a vast number of these but this is enough to illustrate my issue.  I am trying to work out how exactly to distribute the energy.  The producers will produce at set intervals and has no storage capability.  The storage can take energy from the producers and store it and can also send energy to consumers or other energy storage.  The user just takes energy and produces some action with it.

 

I have thought of two ways to approach it.

 

Method 1 - If the element is a user OR storage, then it will look at each other element it is connected to.  If that other element is a producer or storage then it will attempt to take energy from it  If it is a producer it does nothing in this method (but produce energy at a set rate and will then have it available to be taken).

 

Method 2 - If the element is a producer OR storage, then it will look at each other element it is connected to.  If that other element is a user or storage then it will attempt to give it energy.  The user does nothing but when it detect it now has energy it will do something with it.

 

So it is a choice between a push and a pull.  The problem lies between the two storage connected to each other.  In either method they take away from each other with a net transfer of 0.  And I dont think I can just do a detect that if I am a storage and the other is a storage then don't transfer anything.  That wouldnt work if the link between the left storage and the producer didnt exist because then further down the chain that left storage and the end user would never get energy from the right storage if I didnt allow storage to storage transfer.

 

Gets more complicated if say there were 3 storage connected in a triangle linkage with one of them connected to a producer.

 

So any ideas on how to do the energy transfer without getting it stuck in a loop?




PARTNERS