Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 29 May 2000
Offline Last Active Yesterday, 09:13 PM

#5315608 Sunlight theory

Posted by on 17 October 2016 - 06:22 PM

but for all practical purposes, yes use a directional light on your planet from the sun and not a point light

#5306145 Sport management game - what's best for both menu and 2D design?

Posted by on 16 August 2016 - 07:10 AM

I would recommend the c# binding of SFML.  I have used it in conjunction with Winforms before.  You can just throw a control on your winform (I choose a Panel) to represent the area on your form you want to draw the graphics.  You then pass in the control.Handle in when creating a RenderWindow.


Then you will override the OnPaint and OnPaintBackground events/functions of your control.  In the OnPaint you will do all your SFML drawing.  In the OnPaintBackground dont do anything (prevent it from painting background of the actual control).  This will redraw when the control detects it needs to like something covering the window then uncovering it.  If you need to continually redraw then you can do something like override the Idle function/event of the Form and call the Invalidate of the control from there to force a redraw.  Or setup a Timer and call invalidate when the Timer fires.


 How to use SFML is documented on their website on how to go from there.  No real documentation on the embedded thing but on how to draw with SFML. http://www.sfml-dev.org/

#5305378 Highlighting objects in 2d game like in Baldur's Gate/Pillars of Eternity...

Posted by on 11 August 2016 - 03:26 PM

well Baldur's Gate is a pretty ancient game nowadays...1998...but oh how I loved it back in the day.  They *probably* did something along the lines of creating some kind of hitbox (or any general polygon really) and if the mouse was detected to be inside of it, draw it to the screen with whatever generic shape renderer they had access to.

#5302967 Xml Parser, C++

Posted by on 28 July 2016 - 12:41 PM

I second TinyXML.  I use it everytime.

#5300995 Object Referencing

Posted by on 16 July 2016 - 01:24 PM

std::shared_ptr<Type> variable = std::make_shared<Type>();

#5298491 SDL Game Programming in C

Posted by on 28 June 2016 - 10:39 PM

Really?  All these are on the first page of google results for "sdl tutorial"










#5297421 what means these error?

Posted by on 21 June 2016 - 02:33 AM

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.

#5297263 Fast 2d drawing in C# - need a library of some sort

Posted by on 19 June 2016 - 07:25 PM

C# Binding of SFML


#5295072 Handling "jitter" using TCP for a slowpaced MMO

Posted by on 05 June 2016 - 08:07 AM

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.

#5290514 XNA Width And Height Problem

Posted by on 06 May 2016 - 11:25 PM

I have Nvidia msi gt 620 and http://www.geforce.com/hardware/desktop-gpus/geforce-gt-620/specifications it says that my max resolution

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.

#5290447 XNA Width And Height Problem

Posted by on 06 May 2016 - 11:24 AM

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

#5289550 router programming

Posted by on 01 May 2016 - 03:53 AM

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

#5277946 position on grid

Posted by on 24 February 2016 - 01:53 PM

section_x = cell_x / cells_per_section_x;

section_y = cell_y / cells_per_section_y;

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

Posted by 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 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*