Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
hubris.height
Jan 6, 2005

Pork Pro
actually reinstalled pygame to toy around with something similar to this and so far i've gotten far enough into it to be frustrated with pygame's documentation but i keep getting distracted

Adbot
ADBOT LOVES YOU

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

ol qwerty bastard posted:

i hate vector math

WorkingPeer posted:

do you remember high school calc?

no.

okay, relearn all that poo poo

WorkingPeer posted:


like, what the gently caress is this?!?



DaTroof posted:

cistps: spent three hours solving quadratic equations to calculate points in 3d space from mouse clicks

and they said we'd never use this stuff in real life

hubris.height
Jan 6, 2005

Pork Pro
"they" being your dumb rear end friends of the time


this includes mine, mine were more dumb even than you imagine i am

Nelson MandEULA
Feb 27, 2011

"...the biggest shitbag
I have ever met."
i have what i guess you might call "numeracy" problems. like, i drop digits in my head, or swap 4s and 5s, and drop negative signs. so i get the general concepts, but actually doing maths in any practical sense has always been really difficult for me. hence why i dropped from higher level to standard level to maths "studies" in my IB. :saddowns:

Apocadall
Mar 25, 2010

Aren't you the guitarist for the feed dogs?

WorkingPeer posted:

i have what i guess you might call "numeracy" problems. like, i drop digits in my head, or swap 4s and 5s, and drop negative signs. so i get the general concepts, but actually doing maths in any practical sense has always been really difficult for me. hence why i dropped from higher level to standard level to maths "studies" in my IB. :saddowns:

so write all your steps down? and double check your poo poo? we don't all have magic brains that can do calculus in our head, most are good at math just because they practiced it and put effort into it

Nelson MandEULA
Feb 27, 2011

"...the biggest shitbag
I have ever met."

Apocadall posted:

so write all your steps down? and double check your poo poo? we don't all have magic brains that can do calculus in our head, most are good at math just because they practiced it and put effort into it

i do this when i'm writing poo poo down and reviewing it. it's a legit problem, not just slopiness/laziness.

Nelson MandEULA
Feb 27, 2011

"...the biggest shitbag
I have ever met."
like, i'm trying to fix this now, but it's a bit difficult to just jump back into it after failing at it pretty much constantly for my entire life.

Apocadall
Mar 25, 2010

Aren't you the guitarist for the feed dogs?

WorkingPeer posted:

like, i'm trying to fix this now, but it's a bit difficult to just jump back into it after failing at it pretty much constantly for my entire life.

https://www.khanacademy.org/ this was good for me to fix my math

802.11weed
May 9, 2007

no

Werthog 95 posted:

livin the dream. which one

capcom's Breakshot

learnin so much

Sagebrush
Feb 26, 2012

today i fixed my dork hat that i use to track my head's position in flight sims. basically i was having a ton of problems with the overhead lights so i installed a sharp cut infrared filter on the camera but i guess it wasn't the same frequency as the ir leds i was using (grabbed them from the parts box a couple years ago) cause i lost about 90% of my image. ergo i had to buy new leds of the same frequency (850nm). this time upgraded to 10mm leds for a much larger spot at each vertex and sanded them until they're all frosty smooth so that i get a good image from all angles. so far: much smoother tracking and better viewing angles and i can leave the overhead light on too



power switch is kludgy but it works and the hat doesn't get a lot of abuse so eh

now time to go blast some virtual tanks or something :getin:

Nelson MandEULA
Feb 27, 2011

"...the biggest shitbag
I have ever met."

Sagebrush posted:

today i fixed my dork hat that i use to track my head's position in flight sims. basically i was having a ton of problems with the overhead lights so i installed a sharp cut infrared filter on the camera but i guess it wasn't the same frequency as the ir leds i was using (grabbed them from the parts box a couple years ago) cause i lost about 90% of my image. ergo i had to buy new leds of the same frequency (850nm). this time upgraded to 10mm leds for a much larger spot at each vertex and sanded them until they're all frosty smooth so that i get a good image from all angles. so far: much smoother tracking and better viewing angles and i can leave the overhead light on too



power switch is kludgy but it works and the hat doesn't get a lot of abuse so eh

now time to go blast some virtual tanks or something :getin:

:wow:

Nelson MandEULA
Feb 27, 2011

"...the biggest shitbag
I have ever met."
also i'm vista running on an apple cinema display. how dare u desecrate stebe's legacy like that? :mad:

GameCube
Nov 21, 2006

Sagebrush posted:

today i fixed my dork hat that i use to track my head's position in flight sims. basically i was having a ton of problems with the overhead lights so i installed a sharp cut infrared filter on the camera but i guess it wasn't the same frequency as the ir leds i was using (grabbed them from the parts box a couple years ago) cause i lost about 90% of my image. ergo i had to buy new leds of the same frequency (850nm). this time upgraded to 10mm leds for a much larger spot at each vertex and sanded them until they're all frosty smooth so that i get a good image from all angles. so far: much smoother tracking and better viewing angles and i can leave the overhead light on too



power switch is kludgy but it works and the hat doesn't get a lot of abuse so eh

now time to go blast some virtual tanks or something :getin:

always been curious about these, how weird is it to turn your head but keep looking in the same direction

and how excited r u for oculus rift

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Sagebrush posted:

today i fixed my dork hat that i use to track my head's position in flight sims.

cool but for those of us that don't play flight sims, why?

hubris.height
Jan 6, 2005

Pork Pro
whats a good equation for culminative acceleration? currently i'm using

code:
 
velocity[0] += (math.ceil((random.randint(1,5)/6)*(velocity[0]^2))+random.randint(1,5))
and it accelerates alright but it seems to slow down a lot of the time too. any suggestions? just bouncing a pong ball off of all the walls, for now. want to make something out of it eventually though.

GameCube
Nov 21, 2006

Cold on a Cob posted:

cool but for those of us that don't play flight sims, why?

so u can look around ur cockpit naturally with ur head instead of trying to twiddle with a hatswitch or some poo poo

except u have to keep looking at the same screen which always seemed like it'd be super awkward to me

Pile Of Garbage
May 28, 2007



one day i would love to be able to play dcs a-10c but honestly it looks like a steep-rear end learning curve which takes time that i do not have. planes and copters are fuckin rad but i guess my place in life is to enjoy them from the ground.

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Werthog 95 posted:

so u can look around ur cockpit naturally with ur head instead of trying to twiddle with a hatswitch or some poo poo

except u have to keep looking at the same screen which always seemed like it'd be super awkward to me

yeah this seems kinda difficult and annoying (mlmp)

GameCube
Nov 21, 2006

cheese-cube posted:

one day i would love to be able to play dcs a-10c but honestly it looks like a steep-rear end learning curve which takes time that i do not have. planes and copters are fuckin rad but i guess my place in life is to enjoy them from the ground.

if you wanna shoot some poo poo play one of the old ace combats. if you wanna fly a real-rear end plane get x-plane. if you wanna do both good loving luck

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

hubris.height posted:

whats a good equation for culminative acceleration? currently i'm using

code:
 
velocity[0] += (math.ceil((random.randint(1,5)/6)*(velocity[0]^2))+random.randint(1,5))
and it accelerates alright but it seems to slow down a lot of the time too. any suggestions? just bouncing a pong ball off of all the walls, for now. want to make something out of it eventually though.

why are you storing velocity as int? why would a ball randomly accelerate? are you applying this acceleration only when it hits a wall? what are you even trying to do?

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
yeah i'm not understanding that equation either, but it looks like the slowing down might be caused by the accleration being applied in the wrong direction?

like if your acceleration is +1 in the x-direction, or whatever, and your speed is 5, then the speed would become 6

but then if you bounce off a wall or something so your speed is -5, then the speed would become -4 if you just added an acceleration onto it, which then actually slows it down

i dunno though i'd have to see more of the code

anyway i managed to get my collision thing working so that it doesn't sometimes randomly vastly increase the speed of one of the balls (and crash the program), and also so that multiple balls could all collide with each other and be gravitationally attracted to each other



so now they clump together which is kind of cool (i put in a bit of friction too so the energy would dissipate)

a cyberpunk goose
May 21, 2007

ol qwerty bastard posted:



so now they clump together which is kind of cool (i put in a bit of friction too so the energy would dissipate)

:allears: what do you use to make these gifs? now i want to start learning how to do actual collision stuff

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
gooncam to capture it and then photoshop to crop/resize/save for web/etc

it's pretty tedious (especially with several hundred frames, which slows my computer to a crawl) and one of these days i'm going to look up how to make it output to a series of bitmap files instead of the screen so that i can just string them together into a gif

GameCube
Nov 21, 2006

ol qwerty bastard posted:

gooncam to capture it and then photoshop to crop/resize/save for web/etc

it's pretty tedious (especially with several hundred frames, which slows my computer to a crawl) and one of these days i'm going to look up how to make it output to a series of bitmap files instead of the screen so that i can just string them together into a gif

automate that part too while you're at it

hubris.height
Jan 6, 2005

Pork Pro

ol qwerty bastard posted:

i dunno though i'd have to see more of the code

anyway i managed to get my collision thing working so that it doesn't sometimes randomly vastly increase the speed of one of the balls (and crash the program), and also so that multiple balls could all collide with each other and be gravitationally attracted to each other




this loving owns


i just started with a blank canvas and a draw ball updated at 60hz. velocity is added to position which is redrawn on flip. when the ball hits a wall i want it to accumulate some random amount of acceleration. not sure why but it felt like itd be more fun if the acceleration is random. really what i would do ideally is find a way to graph what the result of each tweak on the velocity has in the end and find the ideal equation for it but running the program creates this result anyway so i haven't looked into it.

code:
circ_pos[0] += velocity[0]
circ_pos[1] += velocity[1]

if circ_pos[0]+circ_size > 500 or circ_pos[1]+circ_size > 500 or circ_pos[0]-circ_size < 0 or circ_pos[1]-circ_size < 0:
        if circ_pos[0]+circ_size > 500:
            velocity[0] += (math.ceil((random.randint(1,5)/6)*(velocity[0]^2))+random.randint(1,5))
            velocity[0] = -velocity[0]
        elif circ_pos[0]-circ_size < 0:
            velocity[0] += (math.ceil((random.randint(1,5)/6)*(velocity[0]^2))+random.randint(1,5))
            velocity[0] = -velocity[0]
        if circ_pos[1]+circ_size > 500: 
            velocity[1] += (math.ceil((random.randint(1,5)/5)*(velocity[1]^2))+random.randint(1,3))
            velocity[1] = -velocity[1]
        elif circ_pos[1]-circ_size < 0:
            velocity[1] += (math.ceil((random.randint(1,5)/5)*(velocity[1]^2))+random.randint(1,3))
            velocity[1] = -velocity[1]

draw circle, refresh screen, repeat.
eventually i am going to make the circle an object with a pos attribute so i'm not accessing arrays all the time, but for now this works. it seems like when it hits the top or left side that it loses a significant amount of momentum and i can't figure out why.

fake edit: fixed it by using += universally but now at some point the velocity gets too ridiculous and the draw checks don't happen before its just bouncing out of bounds constantly and then it reaches max integer digit size.

basically don't have an end in mind, just programming this for fun and to pass time at my desk while typing away

real edit: the elifs are useless now

hubris.height
Jan 6, 2005

Pork Pro
can't wrap my head around what kind of equation will result in smooth, quick, random, but manageable acceleration. it would help if i put an upper limit on it too

also velocity is stored as an int because pygame won't let you use a float for position

a cyberpunk goose
May 21, 2007


ffmpeg will eat input frames as well!

if you're on a mac, install brew, then brew install ffmpeg

boom you're done

Dr. Honked
Jan 9, 2011

eat it you slaaaaaaag

hubris.height posted:

can't wrap my head around what kind of equation will result in smooth, quick, random, but manageable acceleration. it would help if i put an upper limit on it too

also velocity is stored as an int because pygame won't let you use a float for position

aaagggghhhhhhhhhhhhhhhhhhhh

do all math with floats and convert to int at the last minute

also if i look at any more of that code i am going to get a brain injury, sorry, i know you are doing things for fun but gently caress

hubris.height
Jan 6, 2005

Pork Pro

Dr. Honked posted:

aaagggghhhhhhhhhhhhhhhhhhhh

do all math with floats and convert to int at the last minute

also if i look at any more of that code i am going to get a brain injury, sorry, i know you are doing things for fun but gently caress

by all means criticise the gently caress out of it unlike my posting i take my attempts to program somewhat seriously


:justprogram:

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

ol qwerty bastard posted:

yeah i'm not understanding that equation either, but it looks like the slowing down might be caused by the accleration being applied in the wrong direction?

like if your acceleration is +1 in the x-direction, or whatever, and your speed is 5, then the speed would become 6

but then if you bounce off a wall or something so your speed is -5, then the speed would become -4 if you just added an acceleration onto it, which then actually slows it down

i dunno though i'd have to see more of the code

anyway i managed to get my collision thing working so that it doesn't sometimes randomly vastly increase the speed of one of the balls (and crash the program), and also so that multiple balls could all collide with each other and be gravitationally attracted to each other



so now they clump together which is kind of cool (i put in a bit of friction too so the energy would dissipate)

see if you can simulate the Theia impact :v:

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

hubris.height posted:

can't wrap my head around what kind of equation will result in smooth, quick, random, but manageable acceleration. it would help if i put an upper limit on it too

do you want smooth acceleration or a smooth trajectory?

coffeetable fucked around with this message at 19:38 on Aug 22, 2013

hubris.height
Jan 6, 2005

Pork Pro
you edited out the perlin noise thing which i'm doing reading on right now. its interesting but not really super relevant i think but i dunno it could be interesting


i would prefer smooth trajectory because smooth velocity means a pretty much uniform rate of acceleration if i'm understanding the concepts correctly

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

hubris.height posted:

you edited out the perlin noise thing which i'm doing reading on right now. its interesting but not really super relevant i think but i dunno it could be interesting

yeah i originally mentioned it cause it's the canonical example of 'smooth randomness', but edited it out cause you're right it's not very relevant

for the rebound thing, how about modelling it as an inelastic collision, then just choosing a random coefficient of restitution (within a range) each time?

e: edited again now that I've remembered my high school physics properly

e2: y'know what I'm gonna step suggesting things until I've had some sleep

coffeetable fucked around with this message at 19:50 on Aug 22, 2013

hubris.height
Jan 6, 2005

Pork Pro

coffeetable posted:

yeah i originally mentioned it cause it's the canonical example of 'smooth randomness', but edited it out cause you're right it's not very relevant

for the rebound thing, how about modelling it as an elastic collision, then just choosing a random constant of elasticity (within a range) each time?

yeah this could work if i keep the range of the rand small and set a total upper limit. if i catch what you mean, its on bounce add random from range x...y and so on. i may have been making it overly complicated by trying to do fancy poo poo instead of just applying a random velocity increase in the single digits.

edit: i am over complicating this.

hubris.height fucked around with this message at 20:25 on Aug 22, 2013

Bloody
Mar 3, 2013

hubris.height posted:

you edited out the perlin noise thing which i'm doing reading on right now. its interesting but not really super relevant i think but i dunno it could be interesting


i would prefer smooth trajectory because smooth velocity means a pretty much uniform rate of acceleration if i'm understanding the concepts correctly

velocity is just the integral of acceleration, so no, smooth velocity does not mean a uniform rate of acceleration. smoothness is just differentiability (as in http://en.wikipedia.org/wiki/Differentiable_function ).

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!

coffeetable posted:

see if you can simulate the Theia impact :v:

my planet keeps shattering :(

need to add damping i think, it's just too rigid

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

if you want smooth acceleration just add a constant to your velocity. you are over complicating this

ol qwerty bastard
Dec 13, 2005

If you want something done, do it yourself!
big ol' collision experiment:



i let it clump together for a while and then fire an "asteroid" at it, which destroys everything

(also holy crap it's simple as poo poo to make python output frames as files, i could have saved so much time)

Sagebrush
Feb 26, 2012

Cold on a Cob posted:

cool but for those of us that don't play flight sims, why?

well airplanes can't just arbitrarily change their direction like an fps man can, so if you are always looking straight forwards out the nose of the plane you'd have to actually turn the whole plane around to see what was behind you. so you have to have a control to look around inside the cockpit if you want to do that. if you're flying a jet airliner you can take your hands off the controls and just use the mouse cause those planes turn slowly and no one is trying to shoot you down, but in a combat airplane you constantly have your hands on the stick and throttle and are always fiddling with buttons and switches. the little point of view hat on top of the joystick can be used to look around but it's kind of crap when you're actually in combat because you don't want to be concentrating on what button to push to move your head, and plus those switches are usually used for airplane functions like radar or target selection or whatever. the head tracker lets you just move your head to look around and track things, and it's actually kind of ridiculous how much better it makes a flight sim.

like, example, you're in a corsair chasing a zero. your corsair is fast and heavy and doesn't turn very well, the zero is light and weakly armored but turns on a dime. you get behind the zero and it turns away. you can try and pull in after him to keep him in your front quadrant so you can see him, but he will out-turn you and make you bleed off all your airspeed because you can't keep up with those maneuvers for long, and then you're hosed. the proper maneuver is to blast past him at maximum throttle, gain a ton of altitude, then dive past him like a cannonball taking a shot in the 0.5 seconds you're in ideal range. then do that over and over again. he can't match your airspeed or climb rate so you're invulnerable while you're climbing and diving and you've brought the battle back to your terms. the problem is that in order to set up that long boom-and-zoom you have to know where the guy is at all times; if you let him get out of your sights he'll disappear and end up behind you again. with a head tracker you can just casually look out the window as you're climbing, always keeping an eye on his maneuvers, without having to shift your plane at all (which is good because every movement bleeds energy).

it also makes the plane feel less claustrophobic i find.

Werthog 95 posted:

always been curious about these, how weird is it to turn your head but keep looking in the same direction

and how excited r u for oculus rift

it's a little bizarre at first but how it feels all comes down to the mapping. easiest way is just to map 1:1 rotation, you turn your head 20 degrees and your viewpoint shifts 20 degrees, but then you can never look more than ~45 degrees off-axis while still seeing the screen. so you can set up a 2:1 or 3:1 map so that you can turn your head 45 degrees and look 90 or 135 degrees to the side, but that makes the center point really sensitive (you need to keep your head really rock steady in that case) and you hardly ever need to look that far off-axis anyway. so what most people do is program it with a curve that gives you about 30 degrees of movement at maybe 1.5:1 since that's where you spend most of your time, and then rapidly accelerates as you get further away from the center. hard to understand in words but it's surprisingly natural after a couple of hours.

i have no interest in the oculus rift until they make one that can do better than a 27" 2560x1440 screen two feet away, which is what i currently have


cheese-cube posted:

one day i would love to be able to play dcs a-10c but honestly it looks like a steep-rear end learning curve which takes time that i do not have. planes and copters are fuckin rad but i guess my place in life is to enjoy them from the ground.

yeh if you aren't already a flight sim person with at least a stick and throttle don't start with the dcs games. get a copy of il-2 for $10 off gog and play with that first, it's still the best wwii sim out there and older planes are a lot simpler to operate -- no radar, no navigation, no computer-guided missiles etc

mega :spergin:

Adbot
ADBOT LOVES YOU

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

yep but at least it's not a dotes, ty for explaining. still seems more difficult than having monitors to your side or whatever but i guess it's a compromise

is there a term for flight sims dudes like grognard for p&p rpg nerds?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply