Jump to content

  • Log In with Google      Sign In   
  • Create Account

Khatharr

Member Since 24 Apr 2010
Offline Last Active Private

Posts I've Made

In Topic: [C++]Need help with a customer & salesman question.

Yesterday, 07:41 PM

Because const correctness quickly becomes an all-or-nothing process in games.

If you start enforcing it in a few places, suddenly you've got functions needing to ensure they are const so they call other functions and those need to be changed. Then it starts to propagate and you've got some library you don't control that operates on a read-only fashion and should be marked as const but isn't, so you need to take steps to fight const correctness because of the third party library.

It quickly becomes an all-or-nothing proposition. If you are providing a library it is less of a choice: be const correct. If you are using libraries and all of them have been careful about that, wonderful for you. But if you re using a bunch of other libraries and any of them are not using it, it quickly becomes the stuff of nightmares.

In practical terms, the main benefit of const correctness is a benefit to the programmer. It can help identify and prevent certain bugs, but assuming other good practices are in place those bugs will be prevented anyway by code tests and code review and QA testing.

Ultimately the options boil down to complete const correctness through the code base or completely avoiding const in the code. In most projects I've worked on professionally, teams have chosen the avoidance route primarily because attempts to reach const correctness are blocked by external libraries.

 

And now I'm emo. I hope you're happy.


In Topic: [C++]Need help with a customer & salesman question.

11 February 2016 - 10:35 PM


* You might want to mark the accessors as const since they don't modify your class contents, but that could start a religious debate on const correctness you may not be prepared to argue.

 

Make them const. Let's do this.

 

knights-templar.jpg

 

(Who actually argues about const correctness? That's like arguing about eating through your mouth.)


In Topic: Behavior Trees or FSM?

11 February 2016 - 10:25 PM

Sorry to possibly throw a wrench in your plans.

 

I have exactly 0 experience in making an AI, but have been reading about various tactics in implementing things, as they look interesting.

 

I know FSMs (but in a different context), and browsed BTs a bit (and like you I have problems picturing its execution).

Recently I ran into GOAP (goal oriented action planners). In GOAP, you let go of rigid order in decision making, and instead have individual actions that you combine into achieving a goal.

 

I cannot tell you how this compares to FSM or BT, or even if it actually works, due to my 0 experience, but it sounds like this may be an alternative that could be of use, for some part of the decision making.

 

GOAP is really for high-level strategizing. It can be pretty smart, but it's really only good at selecting action states. For a game like Shadowrun it would be simpler, but in a top down squad shooter like OP describes it would likely be hybridized with an FSM or similar.


In Topic: Visual scripting vs Coding?

10 February 2016 - 09:29 PM

I sort of like the animation state machines in Unity, but apart from that I really dislike visual scripting, since it's just faster and easier to write out what I want instead of wrestling with a UI.


In Topic: EASTL is now officially open source

10 February 2016 - 12:34 AM

Excellent. Hoping that appropriate bits migrate into the standard, but this is already great news. Thanks, Rob, and thanks EA.


PARTNERS