it seems like you are getting those seg faults in some string manipulation functions. i would look at the possibility that you are indexing into an array beyond its bounds (ie. accessing the 10th character of a string that is only 7 characters long).
Also if you are passing strings into those functions by pointer or by reference and then the original string gets deleted or goes out of scope you could have the same problem.
Say you send two commands with 50ms between them. But for some reason, the second packet gets lost for 500ms and your buffer is only 100ms. By the time you get that second command it would be 350ms late. It can't just forget about that command because that command could be saying to stop the character or something.
For movement i would not send start and stop commands. I would send a steady stream of their current positions.You can still sanity check those positions to make sure their are legal and allowable. Then if you get a position packet with an a "tick" lower than a different one you have received then you can safely ignore it. For one time even things that you CANNOT miss (cast spell, get powerup, etc) then you have to do some kind of reliable over UDP transport yourself....or use TCP but I still recommend against TCP.
is 2048 x 1536 so idk why 900x1300 would be a problem.
yes, your max resolution is 2048x1536, but that does not imply that anything less than that is acceptable. to get an idea of what all video modes your video card supports do the following (assuming Windows 10 but other versions of Windows should be similar):
1 - Right Click your desktop and choose "Display settings"
2 - Click "Advanced display settings" at the bottom of the new window
3 - Now in this window you will see a drop down box titled "Resolution"
4 - This drop down box contains all the resolutions supported by your video card
I am sure they is probably a quicker way to get this information but I dont hack around in Windows too much.
You are setting the preferred width and height. I really doubt that 900x1300 is a supported fullscreen resolution by your video card. So the XNA code tries its best to give you a resolution that is close to what you are requesting
i do plan on using a very basic linux install that will already have the network drivers and tcp/ip stack. i just want to be able to read the packets coming in the port, process them, and forward appropriately
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.
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*
Posted by ncsu121978
on 12 November 2014 - 11:34 AM
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?