• Create Account

# alnite

Member Since 07 Nov 2002
Offline Last Active Today, 12:53 PM

### In Topic: State machine for beginner - how to shoot state AND jump state

10 September 2016 - 06:43 PM

If you look at the image attached I have various states and I think I know how to move between them in theory. My issue though is the shooting state. You see I can shoot and idle, shoot and jump, shoot and fly, shoot and run. As it's a state machine and I can only have one state at a time, does that mean I need 4 new states for those combinations? It's a shame if so due to the duplication of so much code. So I thought I'd check here first and see what the community thinks.

Shoot and Idle, Shoot and jump, could be two separate states, or it could be three possible states with two OR-ed together.  This obviously really depend on the game you are making and the kind of logic you are aiming for.  Most of the time, if you are looking at a 2D game (I'm assuming so since you mentioned Godot), it's safer to keep them separate.

I also prefer to present my states in a table rather diagrams.  List your states on the Y axis, and the conditions on the X axis, then the values is what happens when condition is met.  For example:

```+-----------------+------------------+-------------------+
| State\Condition | BTN_FIRE_PRESSED | BTN_FIRE_RELEASED |
+-----------------+------------------+-------------------+
| STATE_IDLE      | STATE_IDLE_FIRE  |  -                |
| STATE_IDLE_FIRE | -                | STATE_IDLE        |
| STATE_JUMP      | STATE_JUMP_FIRE  | -                 |
| STATE_JUMP_FIRE | -                | STATE_JUMP        |
+-----------------+------------------+-------------------+
```

Column are the conditions, and each row represent that state you are in, and what state is next if the condition is met.  You can organize this into a two-dimensional array (or one-dimensional if you are old-school), then switching from one state to another is a matter of assigning your current state to the value in the table.

```nextState = STATE_TABLE[currentState][condition]
if (nextState != null) {
currentState = nextState
}
```

### In Topic: Completely custom skills mechanic for RPG

05 September 2016 - 11:54 PM

it HAS to be based on recombination selection of precanned elements
that is what I'm going to avoid in my game mechanic.

Of course, it will have some magic laws/rules, but no predefined effects (in any way – in-game effect or graphic effect).

That's going to be the problem.  Although on paper it seems fun and doable, but when translated to code and animation it's almost impossible.  You'd have to procedurally design everything including animations and interactions between atoms.  To make fire looks and feels like fire would require an artist's touch.  Even say you get yourself some fire effects with procedural only, then how do you make water element not look like a blue fire?

We are only talking about the animation here, what about the effects between atoms?

Unless you are reprogramming the universe itself, procedurally generating everything could reach past that threshold of expectation where suspension of disbelief can no longer help you.

### In Topic: Trying to make a complex, albeit fun cooking videogame

28 August 2016 - 02:43 AM

What people here have said.  I think trying to explore the flavor can backfire since you can't really taste what you cook in the game.  What I would like to see, however, is the educational aspects around cooking, baking, and ingredients.  I can see this being useful to teach kids about cooking and baking without putting them in danger of fire.

For example, maybe put real science behind the right oven temperature and the amount of flour and yeast you put in to produce a nice bread.  Maybe a step by step instructions of baking baguettes.  Maybe show different ways of cutting vegetables, e.g julienne cuts.  Proper way to cook bacons.  You just have to keep it fun and educational, and don't be too crazy on the realism part.

### In Topic: Transitioning from game development to business development with C#

27 August 2016 - 05:24 PM

Going into non-gaming jobs have its pros and cons.  An advanced knowledge of C# in Unity carries almost no value whatsoever in non-gaming tech industry.

Let me tell you how these people think.

1. Your worth as an engineer has nothing to do with how smart you are in solving a problem.  You have an O(log N) solution?  Not relevant.

2. What about your wealth of portfolio of sweet and fun games you have made with zero bugs! You know, the work that you spent countless hours and days and weeks and months to finish?  Not relevant.

3. What about your passion in fine tuning the animations, timing, and pacing of the games that you create?  You even created your own mathematical formula for that enemy movement!! Nope, not relevant.

4. What about your C/C++ knowledge of low level pointer manipulation?  You know your bits very well.  Not relevant.

Yup, all that thrown out the window.  Pfft.  Nobody cares about that in the tech industry.

1. Language/framework skills.  Ever seen those job ads for "Software Engineer"?  What are the things they ask for?  Language and/or frameworks.  Do you know Java?  Do you know Rails?  Do you know SQL?  Do you know XYZ Big Big Data FizzBuzz Enterprise for Deep Learning Solutions?  Yes?  You are hired!

2. ....Nothing else

This is why there is soo much hype around new frameworks.  "ZOMG React is da best".  These guys rely heavily on the language and frameworks that they use to get the job done.  If you are a smart programmer using C/C++/Python, and I mean really smart like some members here, you are going to have a hard time landing a job on a company that's using Javascript/NodeJS.  I have been denied a job for stating "Rails sucks" (obviously they were using Rails) during the interview even though I aced all questions.  I know Ruby very well and even presented them an alternative solution in Ruby that's not Rails.  Nope nope nope.

Really.  That's how these people think and operate.  The term "tech stack" is popular for a reason, and zealotry over a particular language or framework is rampant.  It's like going back to gamedev when people were asking about DirectX vs OpenGL, except this is continuously happening on the global scale, and for every new language out there, new zealots are born.

That's why there are accelerated coding schools popping out all over the country like General Assembly, which BTW produce really really crappy engineers.  The scary thing is, companies actually hire them.  Get some no-clue-joe with zero programming background to spend 3 months learning Rails, oh you get yourself a Ruby on Rails Software Engineer.  I used to think all tech engineers are smart.  I was wrong.  They are engineers with a very specific domain knowledge, sometimes with an audacity to claim that Coding is Over(1)

You are most likely to land a job as a C# developer doing some websites in C#.  Even though C# and Java is very close, you'd be very lucky to find an employer that wants to hire you as a Java Developer, which means they might also be desperate and perhaps have an old ugly yucky Java code lying around that nobody wants to look at but you.

Don't get me wrong, there are exceptional engineers out there working in tech space.  After 6 years, I can still count them with my fingers, and there are still less than 5 so far.

Edit: Where's the formatting buttons?

### In Topic: What to consider for an RPG damage formula?

24 August 2016 - 11:47 PM

I wouldn't sweat it much.  Do test it, since different games need different formulas.

Starcraft (the original), as an example, has very simple methods, but it works for that game.

PARTNERS