Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 231 232 [233] 234 235 ... 796

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

Muz

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3480 on: November 15, 2012, 06:50:15 am »

I do wonder how companies like Oracle make money.
Logged
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3481 on: November 15, 2012, 06:54:17 am »

Consultancy. I've worked with Oracle products as a financial analyst for a multi-billion-dollar company. That thing was a monstrosity...
It's a top-down cascade of companies (Oracle is one of em) throwing bags of money at stuff to make it work.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3482 on: November 15, 2012, 06:56:03 am »

throwing bags of money at stuff to make it work.
Sounds nice.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3483 on: November 15, 2012, 06:58:11 am »

So, like Max suggested, I implemented the flyweight pattern, but ...

ARRGH MEMORYLEAK Dx

Back to the drawing board.

Also, the flyweight saves 1.5 MB of ram, so about 10% off. :D
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

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3484 on: November 15, 2012, 07:01:16 am »

throwing bags of money at stuff to make it work.
Sounds nice.
If you're a consultant able to bullshit non IT-people, this is how you make shitloads of money.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3485 on: November 15, 2012, 07:11:41 am »

So, like Max suggested, I implemented the flyweight pattern, but ...

ARRGH MEMORYLEAK Dx

Back to the drawing board.

Also, the flyweight saves 1.5 MB of ram, so about 10% off. :D
Do you know how Creator Pattern works?
Well it also defines what class is responsible for deconstructing objects, in most cases. There are exceptions, but it is the best possible starting point.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3486 on: November 15, 2012, 07:13:45 am »

I actually do know that, but I didn't know it was called GRASP. I just knew that that's how it works. Dx
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

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3487 on: November 15, 2012, 07:17:30 am »

GRASP stands for General Responsibility Assignment Software Principles, but there isn't a single wikipedia page for Creator, instead the GRASP page covers it.  :P
GRASP patterns are a lot less of a structural thing, and a lot more like a general over arching guideline.

dreadmullet

  • Bay Watcher
  • Inadequate Comedian
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3488 on: November 15, 2012, 05:27:43 pm »

In a 4 dimensional vector, the components could be called x, y, z, w. In a 5 dimensional vector, what comes after w? What about higher dimensional vectors? Would you just scrap the letters and use the [] operator?
Logged

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #3489 on: November 15, 2012, 05:32:16 pm »

Not sure if it's a "standard" or not but I've seen and used x y z w h d before. Not sure what you'd use for a 7 to 9d vector, i j k?
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3490 on: November 15, 2012, 05:47:28 pm »

w,h,d, is for width, height, depth, for extra dimensions u,v,w are more appropriate. Personally I reserve i,j,k for iterators.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3491 on: November 15, 2012, 06:10:02 pm »

Doublepost because different subject:

Making a player-object move smoothly in a physics-based platformer is pretty hard. So far I have:
Jumping is an impulse upwards when on the ground. Holding the jump button applies a continuous upwards force while your vertical speed is still upwards.

Moving left or right is applying a force if your current speed is below the maximum speed, and there's a separate force for being in the air and on the ground. Perhaps a different maximum x-speed is warranted when not on the ground.

Now I also need braking, and use friction with the forward force so you can't accelerate as fast when on very smooth surfaces. The controls feel...clunky. Anyone got advice on this?
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3492 on: November 15, 2012, 06:25:05 pm »

At some point you are going to have to have a groundedCheck() to tell when you can jump, or at least handle something similar in the collision detection. At that point you should check for a drag value for what ever you landed on. If you have a tile based world, be sure to set it as a new value instead of just taking it out of the actors velocity, so that if they are standing on two tiles they don't suddenly move at a crawl for no reason.
That should make your moment in the air feel more airborne than just running, will cause you to stop when you stop holding down the move keys, and will let you use really low values for ice to slide on, or really high values for mud.

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3493 on: November 16, 2012, 04:36:24 am »

Oh, forgot to mention, I have that part already :) The jumping works pretty well.

It's just the walking that's off.
I can use the combined friction (boots_friction*ground_friction) as a modifier for the acceleration force when on the ground. Being used to "perfect" platformers (mario-style), everything that uses physics feels clunky. A sideways-sliding-force doesn't really emulate walking, either, as going up even small slopes (The world is not tile-based but composed of arbitrary shapes, right now just an endless sinus function) is very slow, unless you've built up speed, where it will launch you into the air... Both of those effects are unwanted. Emulating a running person is quite hard when you can only do a wheel or sliding block.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3494 on: November 16, 2012, 05:00:30 am »

Yea, that isn't the best idea. Anything with a higher than normal traction value designed to stop you quickly will shoot you when you try running on it. Better to split traction and drag into two separate values. Dirt having normal traction and normal drag, cermet having high traction normal drag, ice low traction and low drag, mud low traction high drag, you get the idea. Point is that you don't want to try and force values to do things they conceptually don't do.
Pages: 1 ... 231 232 [233] 234 235 ... 796