Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 690 691 [692] 693 694 ... 796

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

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10365 on: February 12, 2017, 04:31:42 am »

Good point.
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10366 on: February 13, 2017, 02:30:02 am »

I was reading about flow fields recently, and they look really good for fast and fluid pathfinding for large crowds. I was thinking about putting together a "fortress" type demo in which thousands of agents are traveling around the fort doing various tasks.

Basically, if you don't know, a flow field is a set of vectors over a space which give each location a direction. The idea is that if you have a finite number of interesting places, then they can have a vector field already calculated, and if someone wants to e.g. go to the infirmary they just look up the infirmary's vector field where they are, then "flow" in that direction, instead of running pathfinding.

Obviously if there are a large number of "interesting" places to go or deformable terrain this complicates things a bit more, but the benefits of having pre-calculated paths already worked out is too interesting to ignore. I've been thinking about how compact a flow field could be. If you encode 2 bits as left/right/up/down then that's enough, you can infer diagonals by looking at the code in the next tile you want to move to. With a 64 byte cache reads, that's 512 bits, or 256 tiles, or each memory access gives you 16x16 tiles of pathing data for a single flow-field.

A good design might be to enforce a system of "zones". e.g. give the player incentives to create areas with related functions, living space etc. inside the zones, normal pathfinding would be used, and each zone would have a related flow field which directs visitors towards the zone.
« Last Edit: February 13, 2017, 02:48:34 am by Reelya »
Logged

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #10367 on: February 16, 2017, 01:48:10 am »

Ponderings about C-3PO's probability calculations for whomever is willing to add to the speculation:
Quote
[11:38 PM] GUNINANRUNIN: i had a conversation with someone about how c-3P0 calculates probabilities of survival
[11:38 PM] GUNINANRUNIN: i supposed that he must be using historical data and making decisions about how to aggregate it
[11:40 PM] GUNINANRUNIN: and i was saying it was unlikely that C-3P0 had many historical incidents (if any) of millenium falcon type vessels evading three star destroyers in an asteroid field
[11:40 PM] GUNINANRUNIN: and she was talking about conditional probability and how you can aggregate the results of similar situations to gain a composite probability that represents your current, more specific situation
[11:40 PM] GUNINANRUNIN: i want to know how that works
[11:42 PM] GUNINANRUNIN: and then we talked a little about where C-3P0 gets his data. do the rebels have a database? is it all gathered data from droids they have scattered around the galaxy? do they use stolen imperial and donated sympathizer data?
[11:42 PM] Xanmyral: Well
[11:42 PM] Xanmyral: As to whether the rebels have a database or not, I can quite easily say that the empire did
[11:42 PM] Xanmyral: ...
[11:43 PM] Xanmyral: and then blew it up
[11:43 PM] Xanmyral: Because they're stupid
[11:43 PM] GUNINANRUNIN: if he wasnt using historical data, was he using known facts about the capabilities of the vessels involved and how would he use that info to decide their probability of survival?
NEW MESSAGES
[11:44 PM] Xanmyral: That could work as well. It would depend. Proooobably a neural network (in a deep design, I'm betting) fed info about the capabilities and present opposition, but that is getting a bit too hard for the discussion considering he probably has a far more advanced version of what we have now-a-days.
Logged

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: if self.isCoder(): post() #Programming Thread
« Reply #10368 on: February 16, 2017, 07:48:27 am »

I feel like you might be overthinking it, and he just considered the available data on YT-1300f light freighter capabilities and the historical safety records of vessels traveling at high speed in asteroid fields. I doubt the imperial pursuers came into the calculation at all. After all his statement only and specifically addressed the odds or successfully navigating the field, not of evading the pursuers.
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10369 on: February 16, 2017, 07:53:30 am »

You don't need to worry about the pursuers. Think about it.

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10370 on: February 16, 2017, 11:14:16 am »

Maybe C-3PO runs simulations when everybody else isn't looking? He's at least as old as R2-D2, and while he may have gotten a memory wipe there's never any stated time of how long it takes for droids to develop personality quirks. He could have developed some kind of fixation on odds of survival in weird contingency scenarios. That's not programming though, that's just reasoning about Star Wars.'

Anakin also built C-3PO out of junk, and who knows where half that crap came from. Maybe his brain was a flight computer or astromech droid before Anakin got his grubby hands on it, and has hardware capabilities related to that.
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #10371 on: February 16, 2017, 11:16:25 am »

After all his statement only and specifically addressed the odds or successfully navigating the field, not of evading the pursuers.
True; that's a much simpler problem. That's what I get for working off of memory.

You don't need to worry about the pursuers. Think about it.
Never tell me the odds.
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10372 on: February 16, 2017, 11:36:58 am »

After all his statement only and specifically addressed the odds or successfully navigating the field, not of evading the pursuers.
True; that's a much simpler problem. That's what I get for working off of memory.

You don't need to worry about the pursuers. Think about it.
Never tell me the odds.

Yeah and we have to remember that C3PO is legendarily obtuse about context. And he's little more than a fancy walking dictionary with 6 million languages in that head, yet he's thick as a brick in many ways.

He's almost certainly pulling those odds out of actuary tables somewhere rather than doing any sort of computation. And think about it: wouldn't space insurance agencies benefit by greatly exaggerating the risk of asteroids? They could charge higher premiums for asteroid damage, and dissuade people from going near the asteroids, reducing the risk of a payout.
« Last Edit: February 16, 2017, 11:43:53 am by Reelya »
Logged

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #10373 on: February 16, 2017, 12:30:03 pm »

Is there a way to make it so that my number keys (1-0) near the top of my keyboard only type symbols without affecting any of my other inputs? I only use the numpad for typing numbers anyways.
Logged

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10374 on: February 16, 2017, 12:36:31 pm »

That's more so tech support than programming but it looks pretty easy to do.

http://superuser.com/questions/691960/make-number-row-into-symbols-row-by-default
Logged

breadman

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10375 on: February 16, 2017, 12:44:27 pm »

There are a few more ideas for Windows at http://stackoverflow.com/questions/826986/how-to-make-a-custom-keyboard-layout, and for Mac at http://superuser.com/questions/665494/how-to-make-a-custom-keyboard-layout-in-os-x.

While you're at it, I strongly recommend remapping Caps Lock as a third Control key.
Logged
Quote from: Kevin Wayne, in r.g.r.n
Is a "diety" the being pictured by one of those extremely skinny aboriginal statues?

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #10376 on: February 16, 2017, 01:43:13 pm »

Thanks for the tips Mephisto/Breadman! That set me on the right track.

That's more so tech support than programming but it looks pretty easy to do.

http://superuser.com/questions/691960/make-number-row-into-symbols-row-by-default
I type parentheses and other symbols a lot when editing source code (who doesn't?) and I want it to take fewer key presses.

Spoiler (click to show/hide)
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10377 on: February 16, 2017, 06:39:29 pm »

I keep a near-default keyboard layout for the simple fact that I still wish to be able to type properly on keyboards whose layout I can't control. Being able to type quickly on the shitty default layout is still way more viable than being able to type decently on two different keyboard layouts.
Logged

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #10378 on: February 16, 2017, 07:12:13 pm »

I've never had a problem typing or even programming with default keyboard settings. It's only kind of weird to use the Fn key on a laptop, and that's maybe once or twice a day to turn the brightness down or something.
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #10379 on: February 16, 2017, 11:22:03 pm »

I've never had a problem typing or even programming with default keyboard settings. It's only kind of weird to use the Fn key on a laptop, and that's maybe once or twice a day to turn the brightness down or something.
It's not a problem, per se, to hold shift and press 9, then type my thing and possibly close it with shift+0 if it's not self closing. I'm not being put out. I have two hands and they are rather large hands. But all the same, given that I never actually use the number row (when I type numbers I move my right hand to the numpad and use that; it's faster) but I do use the symbol row, it's really awfully nice to have that capability.
« Last Edit: February 16, 2017, 11:25:14 pm by GUNINANRUNIN »
Logged
Pages: 1 ... 690 691 [692] 693 694 ... 796