Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


iGoogleThis

Member Since 31 Aug 2007
Offline Last Active Nov 04 2014 04:36 PM

Posts I've Made

In Topic: Current state of custom and commercial game engines as of 2014

04 November 2014 - 04:18 PM

Personally I wish I could program as low as I wanted to.  I always have the urge to toss assembly in-line but too much of it leads to portability issues and when shipping a product we as developers like to avoid too much headache. In comes the commercial game engine market right?  They solved a problem fair and square and lowered the barrier of entry.  Which equals more and more independent games. Personally I program everything in C and nothing else but as mentioned here that's because I like to know how things work and it's fast, programmers like fast.

 

At my company we use custom tech only but that's because we don't rely on games as our primary area of business so we can. It is a resource strain otherwise. I've worked on teams that have used Unity but it's like driving a car with a blindfold to me.


In Topic: First Paradise - Hybrid Interactive Fiction

11 May 2014 - 05:41 PM

You can now download both a Windows and Linux build here!


In Topic: Plucking strings from an array

12 December 2013 - 01:08 PM

hey GD,  I have some code I'm trying to get working.  The goal is to take one random string from 2 different arrays and print the result.  Based on the tests I've run I'm having trouble getting a string and not just a set of numbers or unknown characters for some odd reason.  Here is a modified (for clarity) example of what I have now.

void NameGen(WINDOW *win)
{
srand(time(NULL));

	int lstn = rand() % 5;
	int fstn = rand() % 5;


char *surname[5] = { "Carter", "Nagano", "Johnson", "Boustrup", "Smith"};
char *first_name[5] = {"Jeremy", "Chris", "Aya", "Corey", "Eiden"};

wprintw(win, "%s, %s", surname[lstn], first_name[fstn]); 

}

EDIT: Fixed, the above example is actually, infact, exactly how one would go about doing this.  By seeding and setting rand() to the same value as the array you essentially leave it up to the program to spit the results back out at you.  The above sample also works with single characters and numbers.  there is plenty of room for optimization, this function is barebones.  I suggest having something offset a recalculation if you plan on calling something like this more than once so that you don't generate different names every time (unless that's what you desire).


In Topic: Continue reading after set indicators? C FILE I/O

14 July 2013 - 05:11 PM

 

Well something like this should work:

bool useDataFromNowOn = false;

while(!feof(fp))
{
    int ch = fgetc(fp);

    if(useDataFromNowOn)
    {
        ... do something with ch
    }

    if(ch == '*')
    {
        useDataFromNowOn = true;
    }
}

 

You are mighty, thanks!


In Topic: Continue reading after set indicators? C FILE I/O

14 July 2013 - 02:33 PM

I don't really understand what the problem is. 

You can read byte by byte and check for the asterisk, and continue reading and storing data.
If you want faster performance, you could read the file in chunks or the entire file at once.

 

Perhap my understanding of the fgets function is abit slim however if you could elaborate or maybe give me an example that would be badass.  The problem is that I don't know how to check for an asterisk, safe to say I'm not used to doing elaborate file I/O routines.  I have ideas but a well explained solution would be much more helpful.


PARTNERS