Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 494 495 [496] 497 498 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 903516 times)

breadman

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7425 on: May 19, 2015, 04:53:13 pm »

A quick question though, given the function to add noise, what is the point of the add_hill and dig_hill functions and could those be used in conjunction with noise?

It looks like the hill functions are ways to create simple, non-random shapes.  I'm not entirely sure, but you might be better off using them before the add_fbm function.
Logged
Quote from: Kevin Wayne, in r.g.r.n
Is a "diety" the being pictured by one of those extremely skinny aboriginal statues?

bahihs

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7426 on: May 19, 2015, 07:17:30 pm »

A quick question though, given the function to add noise, what is the point of the add_hill and dig_hill functions and could those be used in conjunction with noise?

It looks like the hill functions are ways to create simple, non-random shapes.  I'm not entirely sure, but you might be better off using them before the add_fbm function.

Gotcha, thanks again! I really appreciate the help.
Logged

AlleeCat

  • Bay Watcher
  • Black, the beast, descends from shadows...
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7427 on: May 21, 2015, 11:22:56 pm »

Reposting from another thread, just to make sure I cover all my bases:
I'm running into a slightly different problem now, actually. Basically, I have a general "scavenge" command that will bring up different items in different rooms, but I don't know how to make it so that you can only use the command once in each area without including the room in the command.

So basically, what I want to have happen is that the player can just type "scavenge" in any room without typing "scavenge [room]" but only get the item that returns once regardless of dropping it in another room or having it carried or whatever.

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7428 on: May 22, 2015, 12:44:15 am »

Have each room have an extra flag, and have "scavenge" run a function that flips the flag and gives the item(s) in the room?

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7429 on: May 22, 2015, 01:06:29 am »

A really good talk from GDC 2015. On the topic of writing fast code, SIMD, cache stuff, branching, and some other optimization stuff.
https://www.youtube.com/watch?v=Nsf2_Au6KxU
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #7430 on: May 22, 2015, 03:14:10 am »

I can't decide if I should try to make a game in Typescript (yendor.ts), C++ (libtcod x SDL1), or Python (libtcod) D:

Typescript:
   Pros: Easy to distribute!
   Cons: what is a typescrpit I don't know how to aaa

Python:
   Pros: Easy to rapidly develop in!
   Cons: Good luck distributing it!

C++:
   Pros: It's C++! also probably easier to optimize? I guess?
   Cons: C++. More seriously, slow development and static typing.
« Last Edit: May 22, 2015, 03:20:37 am by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

BlindKitty

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7431 on: May 22, 2015, 03:30:41 am »

I can't decide if I should try to make a game in Typescript (yendor.ts), C++ (libtcod x SDL1), or Python (libtcod) D:

Typescript:
   Pros: Easy to distribute!
   Cons: what is a typescrpit I don't know how to aaa

Python:
   Pros: Easy to rapidly develop in!
   Cons: Good luck distributing it!

C++:
   Pros: It's C++! also probably easier to optimize? I guess?
   Cons: C++. More seriously, slow development and static typing.

Typescript:
  It is a superset of javascript. Also, there should be Visual Studio add-on for it with good support, as MS is behind TypeScript; and Visual Studio is one sweet piece of software. Every time you can't find info about $something in TypeScript, try searching for $something in JavaScript, and using JS solution should work.

C++:
  Static typing is not nice when rapidly developing stuff, but once you have a large codebase and you start trying to pass wrong stuff to methods you will start loving static typing. At least I did.

I don't know about yendor.ts, but it's the same guy behind it as libtcod, ain't it? If so, TS seems like a good choice, really. But that's just me.
Logged
My little roguelike craft-centered game thread. Check it out.

GENERATION 10: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7432 on: May 22, 2015, 04:48:35 am »

Static typing saves a lot of headaches down the track. The main "pain in the ass" is that you get more compiler errors. But this doesn't mean you had more errors than in a dynamic typed program, it just means that the compiler picked up potential flaws in your logic before you actually ran the program.

For example, if you have a combat-unit class that takes a pointer to an AI object that's supposed to tell it how to move, then a static typed language will tell you there is a logical error if you try and point it at e.g. a sound-playing object, whereas a dynamic typed language will just look sideways and whistle going "I'm totally cool with that", and then your players get weird shit happening in their game, which could be extremely expensive in dollars and time to track down. All for want of simple type checking.

Think about how often you wrap "ParseInt" or "IsANumber?" around variables in PHP/Javascript programs. It's something you always need to guard against. That's extra overhead both for the CPU and the programmer, and it's manually fixing it one variable at a time at runtime, what C++ prevents at compile time for all variables without you needing extra function calls.

Basically, errors picked up at compile time are quick to fix and don't cost a lot of money. They can also serve as an early-warning sign that you have issues in your program's design. Whereas with dynamic typing you can write code that makes no sense at all, and the machine totally accepts it as valid until it causes a runtime crash. Which means you have to test EVERY execution branch manually for errors that static typing would have prevented in the first place.
« Last Edit: May 22, 2015, 04:56:34 am by Reelya »
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7433 on: May 22, 2015, 04:57:37 am »

I find the idea of not setting the type of a variable from the start to be very confusing.
Logged

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #7434 on: May 22, 2015, 05:00:45 am »

I'll just leave my obligatory Python recommendation here. There are lots of utilities floating around to turn .py files into .exe files. Py2exe springs to mind, along with cx_freeze.

Also, Python is strongly typed in the sense that it doesn't do implicit conversions: 5 + "4" = ValueError. Although you can then do a = 5; a = "4", which I suppose would be more of an issue.
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

karhell

  • Bay Watcher
  • [IS_A_MOLPY]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7435 on: May 22, 2015, 05:08:06 am »

That's 'cause python doesn't have variables, it has labels ^^
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #7436 on: May 22, 2015, 05:17:56 am »

Something strange about libtcod for python is that it apparently eats a bunch of the tracebacks... if, for example, I try to access an element that doesn't exist it just stops responding instead of printing a traceback and crashing.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #7437 on: May 22, 2015, 05:34:00 am »

I think the wrapper has some internal error handling (for some reason) but it appears to be really inconsistent.
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7438 on: May 22, 2015, 12:55:08 pm »

haha yeah i've worked in python libtcod for long enough to get a game with working attacks, json creature raws and (possibly homing) projectiles that have unique effects, and lemme tell you

crap's kinda bananas when it comes to errors sometimes

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7439 on: May 22, 2015, 01:20:45 pm »

I assume the C# libtcod is still sort of unmaintained? (because C# is best)
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.
Pages: 1 ... 494 495 [496] 497 498 ... 796