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!


ByteTroll

Member Since 13 Sep 2012
Offline Last Active Yesterday, 11:38 PM

Posts I've Made

In Topic: Hello everyone

21 July 2015 - 07:50 PM

Welcome!


In Topic: Problems with vsync on Linux

12 July 2015 - 02:13 PM

First off,

 

 

 


there's no need to show you the code, because it is available on the NeHe website, and you can try it yourself.

 

This is ALWAYS the wrong answer.  If you are asking others for help, you need to make sure that you supply an adequate amount of code that shows the target problem, as well as any error messages that are thrown.  In this case, supplying the required information is even more important as 'NeHe's tutorials are out of date.

 

As far as the bad context situation goes, "GLX_BAD_CONTEXT" is thrown for multiple reasons, however, they all revolve around the fact that your context is not a valid GLX context.  With no code, this tells me that your context creation failed.  Again, this happens for any number of reasons.  For starters, I would try running natively and not in a virtual machine.  If you supplied context creation parameters that the virtual machine does not meet, context creation will fail, thus giving you a bad context, and finally leading to 'GLX_BAD_CONTEXT' being thrown.  If you want more help that that, post the code and errors.

 

EDIT: Adding to the whole extension mess, make sure that if you are using extensions, that they are currently supported and loaded -- especially the vendor specific extensions.  Depending on usage, that could also potentially cause these issues.

 

Byte


In Topic: how to program A LOT of skills/spells?

28 June 2015 - 12:02 PM

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.

 

It has been a good long while since I have worked on a game that uses spells/skills, however, the general theory is that all "castables" have common specific traits.  These traits can include fields such as damage, cool down time, type (AOE, single target, etc), etc.  Store all of these in a base class which can then be derived and implemented per-skill.  As for implementing a large number of these, there are several good approaches, but the one I use the most is to create a scripting type setup where I define these attributes from external file containing JSON.  This way, none of the skills have to be hardcoded.

 

EDIT: Alex has a solid answer.


In Topic: C++ Best Scripting Language

25 June 2015 - 03:26 PM

The best scripting language for C++ is C++. It integrates perfectly and is very powerful. ;)

 

No arguments there rolleyes.gif


In Topic: Read a text file from a .zip container

22 June 2015 - 03:13 AM

I can remember back to when I was writing my filesystem and having this very problem doing exactly what you are doing.  All of my other assets worked fine, but when I tried to read in shaders stored in text files, I got crap binary data on the end, which caused shader compiling to fail.  At first I thought it was encoding, but no matter what encoding I used, I always got it.  The weird thing was that it only happened under Windows.  Under OS X and Linux, the files read as intended.  I noticed that it always appended the same data regardless, so what I ended up doing was reading in the text file and cutting off the last of file that contained the added chars.  Not ideal by any means, but it worked.


PARTNERS