Bay 12 Games Forum

Please login or register.

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

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

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: WorldJem: Priority Madness
« Reply #315 on: November 07, 2009, 09:42:39 am »

Pointers are refrences to the memory where the real value is stored.

An array is a pointer to the first element of a block of memory with the array's contents.

In that way, you can use a pointer as an array(An int* pointer can be used like an int[], etc.)

You get the memory location of a value by prefixing it with &, though I don't know exactly how order of operations works with it, so I usually put &() when the part in brackets involves one or more struct value pointers(or similar).

* in a variable declaration (between the type and name) declares it a pointer(you can have a pointer to a pointer to an int type, for example, as int **var, int** var, int ** var, and likely int* *var and int**var.

When * is used outside of either multiplication or pointer declaration, it "removes" one level of pointerness, allowing editing of the contents of the pointed memory. This change does not affect the pointer itself, just how it is used in an equasion. int* a=1;*a=2; would set the value pointed to by a to 2. This is a useless example, though. Struct access of a->x is probaby identical to (*a).x {brackets likely optional, but I would rather be safe, having one extra pair that the compiler ignores than missing one and having everything mess up because of it}. Similarily, b.x is likely going to work fine as (&b)->x. It's better to use the simpler methods where possible.


Where pointers really excel, though, is functions that return struct pointers.
That FILE* (In C-style file access) is a pointer to a FILE struct(That the programmer really should never need to know the contents of, much less use directly, as visible in stdio.h's comments).
fopen() returns a pointer to a FILE struct, and everyone can be relatively happy that it all works beautifully since you don't have to bother creating and initializing an entire FILE struct by yourself.


Pointers allow you to pass along a refrence to a struct without knowing the contents(you could use a stub struct, or a void pointer to avoid even writing a full struct definition!), and allowing the later functions to EDIT THE ORIGINAL's CONTENTS. This can be a very good thing. (Why C and C++ are still popular, because it gives them a considerable portion of the power of assembly language(and speed), without the programmer having to bother with writing out individual operations.
Logged
Eh?
Eh!

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Priority Madness
« Reply #316 on: November 09, 2009, 10:41:14 am »

This project is very very cool, and I have followed it since its start. I am amazed by how far you have taken it, even though I still don't full understand it. Keep up the good work!

Thank you!

I've just gotten back from my "vacation", and I just have to say that yesterday was the best day of my life ever,
for reasons I can't fully explain. I'm completely rejuvenated, and I'm ready to dive back into my game.

There are a few large projects I'm still in the middle of though... I feel like I'm making excuses.

I'm not sure myself of everything I need to get done, so I'm going to write myself a list, and if
I feel like posting up here, so you can get an idea of how much longer I will be away from this,
and how far along I am getting.

Sorry once again for this huge block of work, but it's completely unavoidable.

BTW: I've been running through a tutorial someone sent me, and I've picked up a few things
that will make me a better programmer. Once I get back to this thing, pages will fly.

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

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: WorldJem: Priority Madness
« Reply #317 on: November 09, 2009, 01:18:46 pm »

Life can get hectic sometimes huh?

Anyways, looking forward to seeing progress on WorldJem continue! 

What tutorial would that be?
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: Priority Madness
« Reply #318 on: November 09, 2009, 07:31:56 pm »

...

I can't really remember.

I think it was Alexhans', but it might have been Alfie's, or even yours.

I'll check when I get home.
I got a list worked out, so I should be better able to gauge the duration of crunch before I can return fully to WorldJem.

I'm getting tired of typing that name... maybe we should change 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

alfie275

  • Bay Watcher
    • View Profile
Re: WorldJem: Priority Madness
« Reply #319 on: November 10, 2009, 11:58:15 am »

I sent the c++ primer if thats what you mean.
Logged
I do LP of videogames!
See here:
http://www.youtube.com/user/MrAlfie275

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Priority Madness
« Reply #320 on: November 10, 2009, 02:25:04 pm »

: )

I'm probably three chapters in, picking up on some new stuff that I should probably already know.
Thanks Alfie!
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: Priority Madness
« Reply #321 on: November 10, 2009, 11:28:23 pm »

I've worked out the numbers, and it looks like if I do two projects a day, for the whole weekend, from Thursday to Sunday night, I should be completely over this school crap.
Finding the motivation is another story though...

: l
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

timmeh

  • Bay Watcher
    • View Profile
    • My Portfolio
Re: WorldJem: Almost Time
« Reply #322 on: November 10, 2009, 11:32:30 pm »

Do it!  Do it!  Do it!

:P  Not sure if it's any help, but I'd love to see this continue :)

That being said, if you need more time to keep your sanity, then by all means.  School, while not nearly as enjoyable as working on a pet-project, is probably more important for both of us at the moment :'(
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: Almost Time
« Reply #323 on: November 10, 2009, 11:40:13 pm »

I've spent literally every spare time slot of more than 20 minutes working on nothing but essays though.
I hate essays with a passion.
My brain is going to melt.
I will get it done for you guys though.
I miss being a part of something fun and exciting.
Here is the list:

5 Page project, due tomorrow, 4 pages done
5 writing assignments (around 1.5 pages each) not started
5 Western Civ. Assignments, simple, but not started

If I get all of that done,
I shouldn't have to worry about school stuff until again until way after Christmas.

I guess it's a matter of will power now.
Thanks for the support timmeh.
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: Almost Time
« Reply #324 on: November 12, 2009, 12:17:32 am »

I've finished the 5 page report, which is a huge relief to me.
This only leaves 10 minor assignments to jog through.
I'm going to get a couple done tomorrow, but work on the game will continue soon.
I've been diving through the C++ primer Alfie sent me,
so I'll be in good shape to handle classes and arrays soon.

I've got a ton of new ideas, and I can't wait to show them all to you guys.
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: Almost Time
« Reply #325 on: November 12, 2009, 12:41:13 pm »

It's time to program this thing again.
Pointers it is.
I've looked through some pointer stuffs, but I'm failing to grasp how I'm supposed to apply them.
Let's start somewhere more dire though.

I have almost 10 different 3D arrays, which hold basic information about the tiles of my world.
I don't think this is the best way to do things.
Instead of having a separate array for each attribute (material, temperature, height, visibility, etc.)
I'd like to have a single array which holds all of the information.
Any ideas?
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: Array Help
« Reply #326 on: November 12, 2009, 01:15:04 pm »

One idea, is to use an array with one more dimention than the space it's suposed to represent: For example ArrayName[4][3][8][0] might be material, ArrayName[4][3][8][1] temprature, and so on. To make it easier to keep track of, you could have some variables (or those constants I think exist in c++, I can't remember any of that language right now) so it's actualy be something like ArrayName[4][3][8][ArrData_Temprature].
But this is just how I'd do it, i don't think it brings any actual advantage in speed over having many separate arrays.
Objects could be used, and I supose that would actualy be the best programing practice if you want it strictly OO, but if you are not very familar with it you might want to wait withn that, if this thing keeps going long enough you WILL be doing a complete rewrite sooner or later, so do what you think will be fun to program.
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: WorldJem: Array Help
« Reply #327 on: November 12, 2009, 01:30:19 pm »

: )

You said what I was thinking. I'm going to rewrite this thing with classes.
Expect something identical to be re-released sometime tomorrow, but with better internal structure.
I'm also thinking of adding some new stuff along the way, but water will still be left out for now.
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: Array Help
« Reply #328 on: November 12, 2009, 01:40:05 pm »

If i'm interpreting what you're saying correctly, that's not what I said at all.

what I said was, familiarize yourself with classes FIRST, building on what you already have for terain and instead practising with classes on some system that you can start from scratch on, like creatures. When you have done a bit of that, and gotten some actual understanding and hands on experience with them, THEN rewrite the tile code.

I'm not 100% I'm correct in that this is the best way to go abautlerning it, but my intuition says so.
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Outcast Orange

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

: )

Oh Armok.
You are difficult sometimes.

I'm starting with tiles because it will help advance the progress of my game.
It's the only way to move into the whole water stuffs direction.
Or we will be stuck with no ecosystem for our creatures to live in.
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
Pages: 1 ... 20 21 [22] 23 24 ... 81