Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411708 Posts in 69402 Topics- by 58457 Members - Latest Member: FezzikTheGiant

May 20, 2024, 02:07:28 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsSpaceHero Command
Pages: 1 ... 33 34 [35] 36 37 ... 43
Print
Author Topic: SpaceHero Command  (Read 105566 times)
happymonster
Level 10
*****



View Profile WWW
« Reply #680 on: November 16, 2012, 04:04:35 PM »

Wouldn't it be better to separate out the title screen and ingame logic/rendering main loop into different functions? At the moment there seems a lot of lines in that ingame loop. Smiley
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #681 on: November 16, 2012, 04:07:11 PM »

I have a question:

If I wanted to abstract the data type internally from one source code file to another in C but be able to deal with arrays or maps of an object type, is this the best approach (once I've located a void pointer for the object in the array or map)?

Quote
char *Return_object_name( void **object )
{
    obj_t *obj = (struct obj_t *)object;
    return obj->name;
}
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #682 on: November 16, 2012, 04:21:10 PM »

Yeh you're probably right, my main() was around 1000 lines before and now is around 200, so it's a dramatic improvement on what it was. Eventually the title screen and menu stuff will be hidden away in a class so that'll clean it up further. Still .. the big comments kind of act as code 'segmenters' for me, which is one way of modularising the code I suppose.

I have a question:

If I wanted to abstract the data type internally from one source code file to another in C but be able to deal with arrays or maps of an object type, is this the best approach (once I've located a void pointer for the object in the array or map)?

Quote
char *Return_object_name( void **object )
{
    obj_t *obj = (struct obj_t *)object;
    return obj->name;
}

this article on OO programming in C may help, but I don't know (except object should be a void* right?).
Logged

happymonster
Level 10
*****



View Profile WWW
« Reply #683 on: November 17, 2012, 02:20:07 AM »

Sorry, yes I meant to type void *

Thanks for the link..!
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #684 on: November 18, 2012, 07:23:43 AM »

Actually, I have spent some time this weekend encapsulating the Alpha struct using void* pointers. I'm happier with this now.  Smiley

Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #685 on: November 18, 2012, 03:17:26 PM »

Actually, I have spent some time this weekend encapsulating the Alpha struct using void* pointers. I'm happier with this now.  Smiley

What's this for exactly?
Logged

happymonster
Level 10
*****



View Profile WWW
« Reply #686 on: November 21, 2012, 11:41:40 AM »

Opps, I missed your reply..!

The Alpha structs are for altering alpha values of various things (cursors, UI tiles, panels, etc..)

I'm currently re-factoring more of the code to use this kind of approach where data is completely private from other areas of the code. It's slow going, but something I've never really explored, so it's really helpful for my development as a programmer.
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #687 on: November 21, 2012, 01:15:04 PM »

The Alpha structs are for altering alpha values of various things (cursors, UI tiles, panels, etc..)

I'm currently re-factoring more of the code to use this kind of approach where data is completely private from other areas of the code. It's slow going, but something I've never really explored, so it's really helpful for my development as a programmer.

Oh no, I was wondering why you are removing the type info altogether. I think I'm missing the point, but forward declaration would allow you to hide the implementation still but retain the types in the function signatures. Unless you are building a more generic system that operates on typeless chunks of data?

Code:
// alpha.h
struct alpha;
alpha* make(float val);
void change(alpha* alpha, float val);

Code:
// alpha.c
struct alpha {
  float a,b,c;
};

Code:
// main.c
#include "alpha.h"
..
alpha* alp = make(4.0);
change(alp,6);
Logged

happymonster
Level 10
*****



View Profile WWW
« Reply #688 on: November 21, 2012, 02:16:27 PM »

It's a more generic system really. I'm still experimenting with different things and seeing what I like best. Smiley
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #689 on: November 21, 2012, 02:31:56 PM »

yeh for sure, i really like programming and thinking about this stuff. this (void*) thing is really just the difference between enforcing your own policies and getting some flexibility, or getting the compiler to enforce them and having to have a more strict design. anyways, enough code talk, lets see some new screenies!
Logged

happymonster
Level 10
*****



View Profile WWW
« Reply #690 on: November 21, 2012, 03:16:03 PM »

I wish I had some!! Tongue
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #691 on: November 22, 2012, 01:39:02 PM »

Sorry this is such a boring blog!  Tongue

One thing that I've seen recently that is interesting is a few analysis of the new X-Com game. It's got very good reviews, yet some criticism. See the good article on Gamasutra for an example.

I still haven't bought the game, and now undecided as the bits I like the most of the original, (line of sight, action points/time units, etc..) are the parts not in the new game.

SpaceHero Command will keep those core features though, but will have more influences from Laser Squad I think.  Wink
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #692 on: November 22, 2012, 02:46:38 PM »

Lol whatever, its a good devlog, but you need to iterate more quickly! Just jam the shit out of the code. Cheesy
Logged

Paul Jeffries
Level 3
***



View Profile WWW
« Reply #693 on: November 24, 2012, 12:27:51 PM »

I think how much you like the new XCOM will depend a bit on where your preferences lie on the 'simulation <-> game' spectrum.  It's mechanics are more simplified and abstract than the original, but the gameplay feels a lot tighter and more focused.  Personally, I think that works quite well in the tactical mode (with the caveat that I'd prefer proper LOS) but I think the strategy mode is much worse than the original - the strategic options you have are pared down to the bone and it is abstracted to the point of ludicrousness.  On the whole I prefer the original, crappy 90s graphics and all, but it's still a very good game and an interesting and worthy new take on the material.  Also, heritage aside, it's a big-budget turn-based squad tactics game - it's worth buying purely for that fact alone.

Vaguely related question (and forgive me if this has already been covered somewhere in the last 40 pages): Will Space Hero Command have a strategic mode, or does it focus in specifically on the tactical battles?
Logged

www.vitruality.com | SPARTAN - Small Pixel Art Animator and procedural tile generator
Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #694 on: November 24, 2012, 12:41:14 PM »

Some really interesting UI designs in this game, I look forward to seeing more.
Logged

happymonster
Level 10
*****



View Profile WWW
« Reply #695 on: November 24, 2012, 01:16:47 PM »

Eigenbom:
Epileptic

Paul:

With the very slow pace of development & re-factoring I've only focusing on the tactical side of things. I haven't even thought about the strategic side of the game.

Zenroth:

Thanks! Smiley
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #696 on: November 24, 2012, 04:14:53 PM »

One thing added:

Objects can now belong to a 'random group', what this means is that when added to the map the map editor will pick one tile at random out of all the ones in the set that belong to the same random group.

This is used to add pattern variation for grass / rock floor tiles at the moment.
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #697 on: November 25, 2012, 10:03:32 AM »

I've now added support for animated objects! So the video panels lights now switch between red and yellow every few seconds. :D
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #698 on: November 25, 2012, 02:13:23 PM »

Disco Inferno

Ok.. my Chaos inspired 4 frame fire animation hasn't worked too well.  Cheesy
Now, how do you do a fire animation in this kind of style..?  Undecided
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #699 on: November 25, 2012, 02:55:27 PM »

show us something!
Logged

Pages: 1 ... 33 34 [35] 36 37 ... 43
Print
Jump to:  

Theme orange-lt created by panic