Author Topic: Hi there, new guy here!  (Read 1393 times)

Offline astarum

  • Level 5
  • *
  • Posts: 17
  • Reputation: +1/-0
    • View Profile
    • Astarum
Hi there, new guy here!
« on: August 26, 2009, 04:35:22 PM »
Heya guys, just thought I would stop by and say hi!  Like the look of the forums - seems to be lots of useful information here!

I have been devloping my own browser based game called Astarum, its one of those space empire buildy ones.  Taken a while but its getting to the point when it will be ready.  Hope I can pass my experiences on to other budding developers!

The game can be found at www.astarum.com

Cheers guys, hope to get to know ya all!

Check out my browser game Astarum at www.astarum.com

Offline Crazy-T

  • Level 19
  • *
  • Posts: 197
  • Reputation: +0/-0
  • Building Games
    • View Profile
Re: Hi there, new guy here!
« Reply #1 on: August 26, 2009, 06:58:11 PM »
Welcome! :) Just going to check your site out now :D
Crazy-T

Offline Crazy-T

  • Level 19
  • *
  • Posts: 197
  • Reputation: +0/-0
  • Building Games
    • View Profile
Re: Hi there, new guy here!
« Reply #2 on: August 26, 2009, 07:02:06 PM »
Well i just registered witch was fine, then loggedin gave me blank white page so i viewed source to see what was there (META Refresh) so i copyed that url, pasted it in the browser then another white page, so done same then finally got onto it. lol
Crazy-T

Offline astarum

  • Level 5
  • *
  • Posts: 17
  • Reputation: +1/-0
    • View Profile
    • Astarum
Re: Hi there, new guy here!
« Reply #3 on: August 26, 2009, 07:21:31 PM »
lol my noobishness strikes again!

I guess some browers disable meta refresh!  Looks like a job for the morning!

Cheers fella :)
Check out my browser game Astarum at www.astarum.com

Offline Crazy-T

  • Level 19
  • *
  • Posts: 197
  • Reputation: +0/-0
  • Building Games
    • View Profile
Re: Hi there, new guy here!
« Reply #4 on: August 26, 2009, 07:49:10 PM »
lol my noobishness strikes again!

I guess some browers disable meta refresh!  Looks like a job for the morning!

Cheers fella :)
Maybe use header()?
Crazy-T

Offline astarum

  • Level 5
  • *
  • Posts: 17
  • Reputation: +1/-0
    • View Profile
    • Astarum
Re: Hi there, new guy here!
« Reply #5 on: August 26, 2009, 07:54:04 PM »
Yep, thats my thinking as well... probably only appears about 5000 times in my code :P

Man I suck hehehe
Check out my browser game Astarum at www.astarum.com

Offline Harkins

  • Level 28
  • **
  • Posts: 424
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Hi there, new guy here!
« Reply #6 on: August 26, 2009, 10:49:41 PM »
Think of every bug as a lesson -- what could you have done differently to prevent or mitigate the error? In this case, a redirect() function that would do the meta refresh would also allow you to edit one piece of your code to change to using the Location header. There's also a nice rule of thumb: you should never, never copy and paste when coding. Maybe cut and paste, but never copy and paste.

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline jannesiera

  • Level 35
  • **
  • Posts: 1,026
  • Reputation: +6/-1
    • View Profile
    • BBGameDesign
Re: Hi there, new guy here!
« Reply #7 on: August 27, 2009, 02:56:52 AM »
Hey astarum, welcome to the community! This really is the place 2 be for browser based game development.

@Harkins, Lol, I've copied and pasted A LOT while developing CeasterTrade xD Really nothing wrong with that.

Offline astarum

  • Level 5
  • *
  • Posts: 17
  • Reputation: +1/-0
    • View Profile
    • Astarum
Re: Hi there, new guy here!
« Reply #8 on: August 27, 2009, 07:20:55 AM »
Heya!  Thanks for the welcome.  I too am guilty of a little copy and pasting from time to time, but i do try and write functions wherever possible!  My main problems with the header stuff is that I keep getting "Cannot modify header information as it has already been sent" errors. That will be down to some hidden whitespace me thinks!

I will keep working on it!!
Check out my browser game Astarum at www.astarum.com

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Hi there, new guy here!
« Reply #9 on: August 27, 2009, 08:33:59 AM »
There's also a nice rule of thumb: you should never, never copy and paste when coding. Maybe cut and paste, but never copy and paste.
This is a rule I tend to live by as well. In fact, that's part of what I've been doing this week. I'm implementing a new module for a Drupal install and found myself needing to do a lot of the same tasks. So, I abstracted those calls into their own module, built a dependency in the one I was developing (as well as the one that I lifted the functions from) and, voila! Now I only need to change one code segment to update ALL portions of the code utilizing that segment.
Idiocy - Never underestimate the power of stupid people in large groups.


Offline astarum

  • Level 5
  • *
  • Posts: 17
  • Reputation: +1/-0
    • View Profile
    • Astarum
Re: Hi there, new guy here!
« Reply #10 on: August 27, 2009, 10:48:06 AM »
There's also a nice rule of thumb: you should never, never copy and paste when coding. Maybe cut and paste, but never copy and paste.
This is a rule I tend to live by as well. In fact, that's part of what I've been doing this week. I'm implementing a new module for a Drupal install and found myself needing to do a lot of the same tasks. So, I abstracted those calls into their own module, built a dependency in the one I was developing (as well as the one that I lifted the functions from) and, voila! Now I only need to change one code segment to update ALL portions of the code utilizing that segment.

Oh man, if only my brain was as big as yours all my problems would be over :)
Check out my browser game Astarum at www.astarum.com

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Hi there, new guy here!
« Reply #11 on: August 27, 2009, 11:14:16 AM »
*checks his cranial circumference* How do you know my brain's bigger? :P

And intelligence isn't the answer to everything. Often, wisdom (gained through experience) is of more value. And other times intuition is also important. It's certainly logical to tell your wife / significant other that those jeans do make them look fat... but I wouldn't recommend it. :P
Idiocy - Never underestimate the power of stupid people in large groups.


Offline astarum

  • Level 5
  • *
  • Posts: 17
  • Reputation: +1/-0
    • View Profile
    • Astarum
Re: Hi there, new guy here!
« Reply #12 on: August 27, 2009, 11:25:47 AM »
*checks his cranial circumference* How do you know my brain's bigger? :P

And intelligence isn't the answer to everything. Often, wisdom (gained through experience) is of more value. And other times intuition is also important. It's certainly logical to tell your wife / significant other that those jeans do make them look fat... but I wouldn't recommend it. :P

Not in the state my wife is in now, shes about 3 weeks from giving birth to our first child.  Thats when the real fun will start.... :p
Check out my browser game Astarum at www.astarum.com

Offline Crazy-T

  • Level 19
  • *
  • Posts: 197
  • Reputation: +0/-0
  • Building Games
    • View Profile
Re: Hi there, new guy here!
« Reply #13 on: August 27, 2009, 12:48:28 PM »
Heya!  Thanks for the welcome.  I too am guilty of a little copy and pasting from time to time, but i do try and write functions wherever possible!  My main problems with the header stuff is that I keep getting "Cannot modify header information as it has already been sent" errors. That will be down to some hidden whitespace me thinks!

I will keep working on it!!
You could add ob_start();
Crazy-T

Offline Nox

  • Level 35
  • **
  • Posts: 768
  • Reputation: +12/-2
    • View Profile
Re: Hi there, new guy here!
« Reply #14 on: August 27, 2009, 02:00:48 PM »
Hi astarum, welcome to the forum and congratulations and all the best for the little one

As for the headers...I believe it's better to create such a structure of the skript that you'd need no output before headers,
separate logic and presentation, fistly do all scripting dacing and when everything's done then in that moment comes any html or output or
whatever, not sooner

What's with the cut/copy/paste? A little hint for the dumb ones please :)
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366 (a must-watch) | Join BOINC - no longer a hype, but you can help never the less

Offline astarum

  • Level 5
  • *
  • Posts: 17
  • Reputation: +1/-0
    • View Profile
    • Astarum
Re: Hi there, new guy here!
« Reply #15 on: August 27, 2009, 02:28:03 PM »
Yeah, this has been a real journey of discovery for me - I basically knew nothing about PHP, MySQL, python or java before I started this (and some may claim that I still dont  ;) ) Its been really difficult, yet rewarding to do.

I just need to keep plugging away with it and finding bugs and upgrading the interface etc...

Check out my browser game Astarum at www.astarum.com

Offline jannesiera

  • Level 35
  • **
  • Posts: 1,026
  • Reputation: +6/-1
    • View Profile
    • BBGameDesign
Re: Hi there, new guy here!
« Reply #16 on: August 27, 2009, 04:31:36 PM »
Yeah, this has been a real journey of discovery for me - I basically knew nothing about PHP, MySQL, python or java before I started this (and some may claim that I still dont  ;) ) Its been really difficult, yet rewarding to do.

I just need to keep plugging away with it and finding bugs and upgrading the interface etc...



Thats the way I like it! Gogogo!!!  ;D

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Hi there, new guy here!
« Reply #17 on: August 27, 2009, 06:07:45 PM »
What's with the cut/copy/paste? A little hint for the dumb ones please :)

Take the following code sample:
Code: (php) [Select]
function doFuncA ()
{
    // generate output
    $output = 'some string';

    // append our delimiter to output
    $output .= ';';
}

function doFuncB ()
{
    // generate output
    $output = 'some other string';

    // append our delimiter to output
    $output .= ';';
}

Now, ignore that this could be handled by a single function taking the $output as a parameter or that we could just replace the delimiter with a constant, this is only for illustrative purposes and I wanted to keep it simple. Notice that the code after the // append... comments is IDENTICAL. What happens when we change the delimiter to a comma in a future code update. We now need to look for each segment where we're adding the delimiter and change that piece of code.

However, if we rewrite the code as:
Code: (php) [Select]
function appendDelimiter ($input)
{
    return $input . ';';
}

function doFuncA ()
{
    // generate output
    $output = appendDelimiter ('some string');
}

function doFuncB ()
{
    // generate output
    $output = appendDelimiter ('some other string');
}

We now would only need to change the delimiter being appended in the appendDelimiter function. Thus, with this code, we saved ourselves from having to change it twice. However, as your program grows, you're likely to save even MORE time from code revisions. As I said, this is not the most efficient way to write this program, that would look more like:

Code: (php) [Select]
define ('MY_DELIMITER', ';');

function appendDelimiter ($input)
{
    return $input . MY_DELIMITER;
}

function generateOutput ($input)
{
    $output = appendDelimiter ($input);
}
Why keep the appendDelimiter function? Well, it's possible since we're delimiting something that this delimiter would be useful in other functions. So, it makes sense to leave it abstracted out. Obviously, this would depend upon your program. But, part of a programmer's job is finding patterns in their code and reducing it to take advantage of those patterns.

Ok, back on subject.

Early congrats on the little one astarum! I have 2... No more for me! lol
« Last Edit: August 27, 2009, 06:09:46 PM by JGadrow »
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Nox

  • Level 35
  • **
  • Posts: 768
  • Reputation: +12/-2
    • View Profile
Re: Hi there, new guy here!
« Reply #18 on: August 28, 2009, 01:37:43 AM »
Ah, DRY and keep it universal and flexible, I get it, thank you
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366 (a must-watch) | Join BOINC - no longer a hype, but you can help never the less

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal