Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 21 22 [23] 24 25 ... 81

Author Topic: Cloud Scream > Development on Pause  (Read 86897 times)

deadlycairn

  • Bay Watcher
    • View Profile
Re: WorldJem: Array Help
« Reply #330 on: November 12, 2009, 03:58:34 pm »

You could also use a struct - although my understanding of them is somewhat limited, they apear to be a simpler form of a class. Of course, if you plan on going Object Oriented later, I suppose there's no point putting it off.

Oh, and Orange, you are the patron saint of newbie programmers everywhere. You are awesome, and WorldJem is awesome. ;D
« Last Edit: November 12, 2009, 04:00:07 pm by deadlycairn »
Logged
Quote from: Ampersand
Also, Xom finds people that chug unidentified fluids pleasing.
Quote from: Servant Corps
Ignorance of magic does not give scientists the power to resist fireballs.

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: WorldJem: Array Help
« Reply #331 on: November 12, 2009, 04:27:58 pm »

Structures are really easy, and unless you need functions for the objects I'd just use them.

A basic structure that would store the variables you mentioned earlier:
Code: [Select]
struct _tile
{
    int material;
    int temperature;
    int height;
    int visibility
};

You could create one like this:
Code: [Select]
_tile my_tile = {0, 1, 2, 3};Which would make a tile called "my_tile" where material=0, temperature=1, height=2, visibility=3

You could also set it up like this, so you can add variables later.
Code: [Select]
_tile my_tile;
my_tile.material=0;
my_tile.temperature=1;
and so on and so forth.
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: WorldJem: Array Help
« Reply #332 on: November 12, 2009, 05:57:00 pm »

That is obviously a C++ example, right?

C would need a typedef or declare _tile my_tile as struct _tile my_tile.
Logged
Eh?
Eh!

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: WorldJem: Array Help
« Reply #333 on: November 12, 2009, 06:58:19 pm »

Yes.  Sorry, should have specified that.
Logged
On the Wall is a Masterfully engraved carving of Urist McHardcastle and Goblins. Urist McHardcastle is surrounded by the Goblins. The Golbins are stamping on Urist McHardcastle. Urist McHardcaste is laughing at the Goblins. The carving related to the prolonged and bloody death of Urist McHardcastle in the Fall of 1659, the Winter of 1659, and the Spring of 1660. On the engraving is an image of Cheese.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Array Help
« Reply #334 on: November 12, 2009, 07:57:35 pm »

Oh, and Orange, you are the patron saint of newbie programmers everywhere. You are awesome, and WorldJem is awesome. ;D

Holy crap. I feel really good now!
Thank you Cairn!

I'm probably going with classes at this point, because I have some practice now.
I'm going to add the basic functions of my game into a new project, rewritten with better syntax and stuff.
The tile class thing sounds like it will make everything much more pretty.

I'll start straight away in the morning.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

SolarShado

  • Bay Watcher
  • Psi-Blade => Your Back
    • View Profile
Re: WorldJem: Array Help
« Reply #335 on: November 12, 2009, 11:37:53 pm »

(Note: Java programer, take my advice with a grain of salt.)

If there's any performance hit from using objects instead of structs, go with structs fot the tiles. After all, what methods does a tile object need?

That's assuming you can mix structs and classes, and that it's not prohibitively confusing to do so. In java, everything is an object, but a c/c++ struct is basicly a class with no methods and all public fields, right?
Logged
Avid (rabid?) Linux user. Preferred flavor: Arch

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Array Help
« Reply #336 on: November 13, 2009, 12:34:44 am »

Sorry, but I'm pretty sure I'm using classes. I've already half learned them.

I'm going to bed early so I can get up and start programming in the morning.
I'm not exactly sure what I'll be doing, but I'm currently just trying to get re-acquainted with my code.
Don't worry, nothing I programmed in is super hard to figure out.
I'll just need to do some basic rewriting.

I'm sure by tomorrow night I'll have something to show for it.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Screw Pointers! Muahaha!
« Reply #337 on: November 13, 2009, 10:43:24 am »

The water! It works! It is fast! It needs tweaked...

XD

You guys have got to see this soon.
But, no pointers involved.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Boksi

  • Bay Watcher
  • Everyone's dumb in their own special way
    • View Profile
Re: WorldJem: Screw Pointers! Muahaha!
« Reply #338 on: November 13, 2009, 10:49:35 am »

Ooh. Sounds like you found some innovative solution then? I'm all ears.

Well, actually, no. That would be weird.
Logged
[BODY_DETAIL:NAIL:NAIL:NAIL]
[HAMMER:HAMMER:HAMMER]

[TSU_NOUN:nose]
[SUN_TSU_NOUN:art:war]

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: WorldJem: Screw Pointers! Muahaha!
« Reply #339 on: November 13, 2009, 11:17:10 am »

I'm glad Orange... As with ToA... I'll have to check this out later...
Spoiler (click to show/hide)
Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Screw Pointers! Muahaha!
« Reply #340 on: November 13, 2009, 12:03:19 pm »

Innovative solution, not so much.
I shouldn't have assumed water was the culprit of frame rate loss.
It was actually something I added into the flow along with the water that was robbing frames.
An extra map-wide visibility check was doing the most damage. I made a more primitive version of it that works along with the water better.
Now it is fast.

Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Argh! I need pointers badly.
« Reply #341 on: November 13, 2009, 01:24:09 pm »

So I don't need the pointers to maintain running speed,
but I still will need them for other stuff, including water.

I'm going to leave the game in it's currently playable state (with badly functional water included)
and go transform my tile system into a class-based thing.

This should greatly simplify the code, and probably optimize performance a bit.
Then, after I'm comfortable with that, I'll start picking at pointers again.

Jeez, dynamic physics are hard to handle.
It's taken me near a month so far.

Well, once I get this under my belt, I think things will go much faster.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Argh! I need pointers badly.
« Reply #342 on: November 13, 2009, 04:55:09 pm »

I don't have anything to show for it, but I've been stressing over classing my game, and have made some major steps in the right direction.

I've also decided on a new name for the game.

From henceforth, it shall be referred to as "Cloudscream".
I hope the name sticks.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: WorldJem Renamed: Cloudscream
« Reply #343 on: November 13, 2009, 05:01:18 pm »

May I ask for the reason for that name?
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

alfie275

  • Bay Watcher
    • View Profile
Re: WorldJem Renamed: Cloudscream
« Reply #344 on: November 13, 2009, 06:56:46 pm »

@Orange Just incase you didnt get my message: problem solved.
Logged
I do LP of videogames!
See here:
http://www.youtube.com/user/MrAlfie275
Pages: 1 ... 21 22 [23] 24 25 ... 81