Recent Posts

Pages: 1 ... 8 9 [10]
91
OutpostHD / Migration to Git
« Last post by leeor_net on March 30, 2018, 03:57:14 PM »
Been meaning to do this for awhile and finally got around to it... OutpostHD is now officially running on git:

https://github.com/ldicker83/OPHD

I've scrubbed the history of the data files so I don't think I'll be doing any sort of IP infringement. Still need to find a place to put the dependency and asset files but I'll be updating the main thread when I do that.
92
Other Projects / Re: More Random 3D Stuff
« Last post by White Claw on March 29, 2018, 08:33:07 PM »
You continue to impress me with your progress (and patience with Blender!).

Thanks! :)  It certainly takes patience and humility.


My eyes are kind of drawn towards the edge closest to the camera...I sort of feel like the 3D effect is somewhat lost there, and it looks significantly flatter.

I think I see what you mean. Somewhat strange though, because there's nothing particularly different about those feathers compared to the others. Though the smaller feathers do seem to look fatter (which is possibly a mistake itself).

Though upon looking at my reference photos again, I noticed the feathers out at the wing tips (called Primaries) are not anatomically correct. The rachis (the quill-like part that runs down the middle) is not properly placed. It's too centered in the render. Perhaps your brain knows that these feathers are supposed to be different, but they aren't (so it somehow looks "off"). I will fiddle with that part, and they also need some shaping. Maybe that will help.

The feathers stack on top as they progress from the wing root out to the tips. So the overlap is correct, but perhaps it's too much (too big of a gap).

Thanks for the feedback.
93
Game Discussion General / Re: Chaotic Planar Prison - Prototype V3
« Last post by lordpalandus on March 29, 2018, 09:37:17 AM »
Interesting. That would explain some of the other sections of the code as well. Such as:

Code: [Select]
while True:
...

Where the while loop is only terminated when you reach a Return statement. Otherwise it loops permanently. Generally I've only seen C++ or JavaScript loops where there is a specific Boolean condition attached to the loop. ie:

Code: [Select]
while (x > 0 and x < 10): 
...

Thanks for giving a link on Truthy/Falsy!
94
OutpostHD / Re: OutpostHD - An Outpost Redesign
« Last post by Hooman on March 29, 2018, 08:03:13 AM »
I love static code analysis.  :)

Which is also one of the reasons why I like compiled languages. They generally do at least some basic syntax and semantic checking up front during the compile stage, so you can catch a whole wide range of errors easily and quickly.

Then there are other software packages (I think one culprit was MatLab), where a program can run for an hour before aborting with a syntax error.  >:(

When I first moved to Ruby, I sorely missed the syntax check from a compile phase. Automated tests become a lot more important in a language like that. Which unfortunately have to be manually written.

It is impressive though what some of those C++ static analysis tools can catch, which a compiler typically won't check for. Glad you got that working.  :)
95
Other Projects / Re: More Random 3D Stuff
« Last post by Hooman on March 29, 2018, 07:49:14 AM »
Huh, wow. That is quite organic looking.

That looks like it took a lot of time.


My eyes are kind of drawn towards the edge closest to the camera, like there is something odd about that one part. Like the feathers overlap in the wrong direction or something. I sort of feel like the 3D effect is somewhat lost there, and it looks significantly flatter. Perhaps even confusing. The rest of the wing looks like it has a lot of depth to it. Is this maybe a perspective thing from being too close to the camera, or is there something structurally different there?
96
Game Discussion General / Re: Chaotic Planar Prison - Prototype V3
« Last post by Hooman on March 29, 2018, 07:38:17 AM »
As an aside, on my install of Linux, the default version of Python is 2.7.

I just tested the enum example code from the first section of the docs, and it all works. I've also read the Enum stuff was backported to earlier versions of Python. Looks like you should be fine to use it.



As for your code, it's doing something interesting that you might not be aware of. Python (and other languages, such as Ruby) have both Boolean values (True and False) as well as Boolean-like values (Truthy/Falsy). Conditional tests extend the concept of True/False to cover non-Boolean values under corresponding Truthy/Falsy classifications. This allows for shorter code to check certain common conditions, though may be a little unexpected if you haven't seen it before. It allows testing for things such as 0/1 (Integers), empty/non-empty strings, and empty/non-empty lists.

For instance, you can check if a string is empty using either of the following:
Code: [Select]
if len(string) == 0:
  ...

Code: [Select]
if string:
  ...

As your string is a hardcoded constant, and of non-zero length, it has a Truthy value, and so the if block if always executed. What you wrote is roughly equivalent to:

Code: [Select]
if True:
  ...

StackOverflow has more discussion on Truthy/Falsy in Python, including a more complete list of Truthy/Falsy values.
97
Game Discussion General / Re: Chaotic Planar Prison - Prototype V3
« Last post by lordpalandus on March 28, 2018, 10:00:32 PM »
That is a snippet of code related to the shoot_arrow() function call, without the temporary variable. With it would look like:

Code: [Select]
temp = shoot_arrow()
   if temp == 'took turn':
       for object in objects:
           object.clear()
       return 'took turn'
   elif temp == 'cancelled':
       return 'didnt-take-turn'

The shoot_arrow() function if it hits a valid target returns 'took turn'. If you cancel or shot the floor, it returns 'didnt-take-turn'.

Now, in the main event loop there is this chunk of code:
Code: [Select]
if game_state == 'playing' and player_action != 'didnt-take-turn':
   for object in objects:
       if object.ai:
           object.ai.take_turn()
         

If the player doesn't take a valid turn, the enemies do not get to act. Otherwise the game is constantly looping, without end. Whenever your action returns a string that is anything but 'didnt-take-turn', enemies get to act; otherwise they don't. If you remove the 'didnt-take-turn' from the chunk in the main event loop, the enemies would act nonstop with nothing preventing their actions. Effectively, that can turn the game from a turn-based game to a fully real-time game.

I don't personally like this solution, but it is how the developer of the tutorial did it so, I've left it alone. When I do the code refactor, I'm going to have to modify the main event loop a fair bit, so I'll likely change this then as well.

Probably should have mentioned the main event loop portion when talking about the returning of strings before. Sorry about that.
98
OutpostHD / Re: OutpostHD - An Outpost Redesign
« Last post by leeor_net on March 28, 2018, 09:24:14 PM »
I just checked out the PVS-Studio Analyzer website. Neat little tool. Looks to do the same sort of thing as Coverity Scan.

It basically is but it integrates well with Visual Studio and its code analysis has helped me find many bugs in my other project Rogue Arena. I didn't realize how useful static code analysis was. It also turns out that Visual Studio has static code analysis built into it even in the free community edition though it missed a lot of what PVS-Studio flagged (and found things PVS-Studio missed).
99
Game Discussion General / Re: Chaotic Planar Prison - Prototype V3
« Last post by leeor_net on March 28, 2018, 09:10:59 PM »

... as I found out that I have to explicitly add a temporary value with the stored returned value in order for it to do if-elif statements. So as an example:

Code: [Select]
if 'took turn': 
 for object in objects:
  object.clear()           
 return 'took turn'
elif 'cancelled':
 return 'didnt-take-turn'

...

Consider revising what you're stating here as I don't follow. This is nonsensical as I'm understanding it... at least from the point of view of someone coming from a background and experience with PHP, C++ and BASIC. Python isn't my favoriate language and it does a lot of weird things but it is still a language that's supposed to make sense... would like to be able to help you out with potential improvements to structured programming.

Also note that depending on how your calling code is formed this could very easily result in an infinite loop in the case of 'took turn'.

Unrelated note -- You can surround your code with [ code ] [ /code ] tags or select your code and click the button with the '#' symbol in it. Makes posting code a lot easier and more readable.
100
Other Projects / Re: More Random 3D Stuff
« Last post by leeor_net on March 28, 2018, 08:59:33 PM »
::blinks::

That's quite good. You continue to impress me with your progress (and patience with Blender!).
Pages: 1 ... 8 9 [10]