Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 37 38 [39] 40 41 ... 796

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

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #570 on: January 14, 2012, 10:54:21 pm »

Eh, it gets to a stage where all you can do is build an entire house out of black boxes.
Make a single unit work, and work mother fucking well, then build another on top, and another on top of that. By the end of it you can't remember any one box, but you know they work.

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #571 on: January 15, 2012, 03:57:13 am »

Thanks for the tip, that'll at least make my code look a little better.  I would like to at least appear to know what I'm doing.


The real confusion comes from having to shuttle information in and out of the main program body, through the map object and it's list of objects in the map, and then turn that information back around and send it to the Console, all without refreshing the screen every cycle.

I suppose the sensible thing to do next would be to eliminate them from the lists and update the screen.  Then make the guys move around.  Then make them only move when I take a valid action.  Then I can move onto more high level reactions.  Perhaps the most critical lesson in programming, besides inspect every goddamn letter, is to take nothing for granted.  There is no such thing as a small task, and you must inform the program of every single meticulous step involved in every single action.  You must become one with the machine.

Ommmmmmmmmmmmmmm...

*smacks his case*

Gorram fan noise, anyway.
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #572 on: January 15, 2012, 04:06:44 am »

Perhaps the most critical lesson in programming, besides inspect every goddamn letter, is to take nothing for granted.
Very much this. I've helped enough people debug their code to know that the problem is almost always in the one place they are 100% certain works and so didn't bother testing as the possible origin of the bug. That and preconceptions about the code will impede one's ability to debug it when it fails to run as expected.
Logged

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #573 on: January 15, 2012, 10:46:44 am »

A check will be faster than a write. How about you keep a buffer of the current frame, a buffer of the next, and then flush and only draw the cells that are different? You're still iterating for everything on the screen but that's peanuts compared to the cost of drawing in the first place...
« Last Edit: January 15, 2012, 10:48:33 am by MorleyDev »
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #574 on: January 15, 2012, 05:37:32 pm »

You must become one with the machine.
Drunk mans talk, but this is it. I tried to explain programming again to people today, but this is what it's about.
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))

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #575 on: January 15, 2012, 05:45:40 pm »

You must become one with the machine.
Drunk mans talk, but this is it. I tried to explain programming again to people today, but this is what it's about.

We are the Borg. Lower your shields and surrender your ships. We will add your biological and technological distinctiveness to our own. Your culture will adapt to service us. Resistance is futile.
Logged

Siquo

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

Well, there's this one guy who apparently said: "If you're 'in the flow', stop programming".
It's especially useful advice for enterprise level projects, and exactly the reason why I'm going to quit my current job.
No inspiration AT ALL.
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))

kaenneth

  • Bay Watcher
  • Catching fish
    • View Profile
    • Terrible Web Site
Re: if self.isCoder(): post() #Programming Thread
« Reply #577 on: January 15, 2012, 07:59:29 pm »

Computer programming is like giving instructions to an evil genie.

On the plus side: it does exactly what you tell it to do.
On the down side: It does exactly what you tell it to do.
Logged
Quote from: Karnewarrior
Jeeze. Any time I want to be sigged I may as well just post in this thread.
Quote from: Darvi
That is an application of trigonometry that never occurred to me.
Quote from: PTTG??
I'm getting cake.
Don't tell anyone that you can see their shadows. If they hear you telling anyone, if you let them know that you know of them, they will get you.

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #578 on: January 15, 2012, 08:07:34 pm »

Computer programming is like giving instructions to an evil genie.

On the plus side: it does exactly what you tell it to do.
On the down side: It does exactly what you tell it to do.

Which sometimes makes it do some unexpected but kind of neat things.  Like that one time I was drawing points in a circle and was calculating position with trig functions.  For some reason, my very green programmer self had typed that the variables involved would be ints instead of doubles.  It leads to a kind of bike wheel spokes effect.

Tutorial is coming.  I just need to find both time and motivation.  Both are a bit lacking right now...
Logged

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #579 on: January 15, 2012, 08:08:29 pm »

Computer programming is like giving instructions to an evil genie.

On the plus side: it does exactly what you tell it to do.
On the down side: It does exactly what you tell it to do.

Well, it's more like a retarded genie.  It's not that it interprets your orders against your wishes, rather that it has absolutely no idea what you're trying to tell it.
Logged
And here is where my beef pops up like a looming awkward boner.
Please amplify your relaxed states.
Quote from: PTTG??
The ancients built these quote pyramids to forever store vast quantities of rage.

Vactor

  • Bay Watcher
  • ^^ DF 1.0 ^^
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #580 on: January 15, 2012, 09:42:52 pm »

Here's a little something I made this weekend.

Right now it makes cylinders with arbitrary radium, facets, and length, with the option of twisting it into a helix around another cylinder(or helix) at arbitrary distance and wavelength.

This is a tool I hope to use to generate maps for an artsy game project i've been hatching.

The funny part about this is that the picture in the spoiler below was the easy part, the hardest part was designing and debugging the cylinder builder.  Once that was in the twisting and modifiability just fell into place.

Each cylinder in this is its own procedurally generated mesh, this keeps my draw calls low, even with around 1million polygons on screen i'm getting 64fps (fps cap)  the triangles can be brought down quite a bit if i need to as well, since right now each cylinder has way more faces than it needs.

Spoiler (click to show/hide)
Logged
Wreck of Theseus: My 2D Roguelite Mech Platformer
http://www.bay12forums.com/smf/index.php?topic=141525.0

My AT-ST spore creature http://www.youtube.com/watch?v=0btwvL9CNlA

kaenneth

  • Bay Watcher
  • Catching fish
    • View Profile
    • Terrible Web Site
Re: if self.isCoder(): post() #Programming Thread
« Reply #581 on: January 15, 2012, 10:04:53 pm »

That is some sexy curves right there.

Can you do things like animate the wavelength of the curves to make them crawl along each other?
« Last Edit: January 15, 2012, 10:06:29 pm by kaenneth »
Logged
Quote from: Karnewarrior
Jeeze. Any time I want to be sigged I may as well just post in this thread.
Quote from: Darvi
That is an application of trigonometry that never occurred to me.
Quote from: PTTG??
I'm getting cake.
Don't tell anyone that you can see their shadows. If they hear you telling anyone, if you let them know that you know of them, they will get you.

Vactor

  • Bay Watcher
  • ^^ DF 1.0 ^^
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #582 on: January 15, 2012, 11:31:32 pm »

That is some sexy curves right there.

Can you do things like animate the wavelength of the curves to make them crawl along each other?

nothing that fancy, as these are being made to be a static map, but the way I built the cylinder generator it wouldn't take much to do something like that, it wouldn't be able to handle as many verticies, as right now it builds the meshes once.  Helixes twisting around a cylinder would work easily, as they already have a rotational matrix built in them, and would just need to have that variable changed each frame, but the helixes twisting around a helix would require the meshes to be rebuilt every frame.

The project I designed it for needs them to be static, so I didn't design it with that functionality in mind.  I probably would have done it a bit differently if I was planning on having them move and flex.
Logged
Wreck of Theseus: My 2D Roguelite Mech Platformer
http://www.bay12forums.com/smf/index.php?topic=141525.0

My AT-ST spore creature http://www.youtube.com/watch?v=0btwvL9CNlA

eerr

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #583 on: January 16, 2012, 12:58:35 pm »

Would it be faster to draw if you simply made mappings for each cylinder into pixels?
Ex: a math function returns RGB,depth the pixel for X,Y coordinate for each cylinder?
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #584 on: January 16, 2012, 01:33:46 pm »

Would it be faster to draw if you simply made mappings for each cylinder into pixels?
Ex: a math function returns RGB,depth the pixel for X,Y coordinate for each cylinder?

You want to make the graphics engine draw cylinders instead of polygons?

First, graphics drivers work REALLY good with polygons and drawing cylinders instead of polygons probably wouldn't even be faster.
Second, your graphics would probably be acceptably fast if your graphics driver were written to handle cylinders separately, but what about the spirals and spiral spirals?
Third, it's already fast enough.
Logged
Pages: 1 ... 37 38 [39] 40 41 ... 796