The Simple Questions Thread
Re: The Simple Questions Thread
Okay, I need some programmer advice here. Graf, I need your help, mate.
When using arrays, is starting from non-zero index (say, 1) considered a heavy offence? Does it even matter if you'll start from 0 or 1, considering you've written your code to work with whatever you've picked?
Talking about C++ here, btw, just in case it matters.
EDIT: Alright, in the mean time I searched around for some read on the topic and found this article.
I asked the question because I was arguing with a colleague and his programmer friend about what the "correct" method is, but neither of them managed to put some proper arguments on the table. Well, apparently, starting from the zeroth element in a zero-based array is the right thing to do. Now I at least know WHY it's like that, which was the whole point of the argument. Remember, folks. If you can't explain why, then you probably shouldn't be talking in the first place.
And by correct method I meant for(int i=1; i<=10; i++) vs. for(int i=0; i<10; i++).
When using arrays, is starting from non-zero index (say, 1) considered a heavy offence? Does it even matter if you'll start from 0 or 1, considering you've written your code to work with whatever you've picked?
Talking about C++ here, btw, just in case it matters.
EDIT: Alright, in the mean time I searched around for some read on the topic and found this article.
I asked the question because I was arguing with a colleague and his programmer friend about what the "correct" method is, but neither of them managed to put some proper arguments on the table. Well, apparently, starting from the zeroth element in a zero-based array is the right thing to do. Now I at least know WHY it's like that, which was the whole point of the argument. Remember, folks. If you can't explain why, then you probably shouldn't be talking in the first place.
And by correct method I meant for(int i=1; i<=10; i++) vs. for(int i=0; i<10; i++).
- darkhaven3
- Posts: 502
- Joined: Mon Jan 05, 2004 5:33 am
- Location: East Germany, 2023
- Contact:
Re: The Simple Questions Thread
Your colleagues have not been able to put forward any good arguments one way or another because there is no correct method. You are free to begin from whatever element number in the array you please, as long as you account for that correctly in areas of code where that's important.Lud wrote:When using arrays, is starting from non-zero index (say, 1) considered a heavy offence? Does it even matter if you'll start from 0 or 1, considering you've written your code to work with whatever you've picked?
Starting from the "zeroth" element is no more "correct" than starting from the first or the tenth or the nineteenth.
Re: The Simple Questions Thread
Simple question. With CountInv now a DECORATE expression, is there any difference between A_JumpIfNoAmmo and A_JumpIf with CountInv? Which one is easier on the engine and is less likely to be looked down upon by Graf? (And Graf looking down upon something means it's not the right way, which is what I'm asking here.)
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: The Simple Questions Thread
A_JumpIfNoAmmo is not synonymous with A_JumpIf(CountInv(blah)), because it calls the weapon's CheckAmmo function which does a few more checks (like infinite ammo DMFlag and a few other things that are necessary to handle a weapon. )
Re: The Simple Questions Thread
Makes sense. WIll remember. Thanks, Graf!
Re: The Simple Questions Thread
I've been wondering why older shooters like Doom originally didn't have jumping or crouching. Just watching Romero's play-through of his E1M8b it came to mind how easy it would be in reality to simply climb up short ledges and just reach the switch you would normally have to go around the entire map to reach, so why didn't id Software originally code the ability to jump and crouch? Did they not think of that or was it too complicated on the original engine to allow such a mechanism? It didn't take long to add it though since RoTT was able to make the player gain vertical height with jump pads, then Duke 3D of course actually adds jump for real. Would the original Doom engine have been capable of doing jump actions?
Re: The Simple Questions Thread
It's not because it was too complicated. It's because it had never been done before. It simply hadn't been thought of. Doom came from a time when rogue-likes were common, and games like Dungeons and Dragons took the spotlight. There had never been jumping or crouching in such games.Nevander wrote:so why didn't id Software originally code the ability to jump and crouch? Did they not think of that or was it too complicated on the original engine to allow such a mechanism? It didn't take long to add it though since RoTT was able to make the player gain vertical height with jump pads, then Duke 3D of course actually adds jump for real. Would the original Doom engine have been capable of doing jump actions?
In a lot of ways, Doom is more like a role playing game than it is like a first-person shooter, the very genre that it helped define. The idea just had not sparked yet.
Another example of what came from those times is the keyboard turn - something that ZDoom still does by default. Most shooters nowadays have that completely removed - but that is how you controlled your marine - or in the case of Wolf3D, BJ. In 3D adventure RPG games, keyboard turning was a way to move around in the environment. Granted Doom's was a lot smoother, whereas the other games tended to be more crude and clunky - but the concept remained exactly the same.
Re: The Simple Questions Thread
Oh how I hate the keyboard turn. I could understand back in the days of keyboard only controls, but now it's likeEruanna wrote:Another example of what came from those times is the keyboard turn
Re: The Simple Questions Thread
Is it possible to have more arguments for actors?
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: The Simple Questions Thread
Be more specific. What do you want to do?
Re: The Simple Questions Thread
I don't have any ideas in particular. I meant if it's possible to add more than 0-4 args for the Args[] actor property (engine-side), which can then be applied in GZDB. In case I want to make a customizable actor with lots of arguments that could be changed to affect said actor in different ways.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: The Simple Questions Thread
No. If you want more values you have to add new variables to your subclasses.
Re: The Simple Questions Thread
I see. Can I control them through GZDB, though? UDMF custom properties, perhaps? Never got what that was for... the documentation isn't too helpful, either.
Re: The Simple Questions Thread
This is yet another funny question, but since this is Off-Topic, I guess it's good to go 
I've read about this new fashion-fad, the "murse" (man purse). Many girls/women said it is uncool and laughable if a man carries a murse around, and that "a true MANLY man never buys a murse, let alone get out in public with one". Is it true? What are your experiences with murses?
Oh, and I don't have one either, I have a perfectly good army bag.
I've read about this new fashion-fad, the "murse" (man purse). Many girls/women said it is uncool and laughable if a man carries a murse around, and that "a true MANLY man never buys a murse, let alone get out in public with one". Is it true? What are your experiences with murses?
Oh, and I don't have one either, I have a perfectly good army bag.
- Caligari87
- Admin
- Posts: 6241
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: The Simple Questions Thread
I used to carry a "murse" and don't think there's anything wrong/weird/uncool with it (I simply have no need to do so anymore aside from occasionally taking my laptop bag somewhere). I also have no compunctions carrying my wife's purse, which people seem to think is even weirder for some reason. 
My reason was generally the same as a purse: MP3 player, headphones, a knife, sketchbook/notebook, pens/pencils, first-aid kit, reading material, random cables/chargers, lunch/snack, etc. Sort of a "surban survival kit" if you will. Eventually I simplified and mentally phased out my "need" for those things, so now it's just what can fit in my pockets + a small lunchbox on workdays.
I loved my murse though. Maybe someday I'll start carrying it again.

My reason was generally the same as a purse: MP3 player, headphones, a knife, sketchbook/notebook, pens/pencils, first-aid kit, reading material, random cables/chargers, lunch/snack, etc. Sort of a "surban survival kit" if you will. Eventually I simplified and mentally phased out my "need" for those things, so now it's just what can fit in my pockets + a small lunchbox on workdays.
I loved my murse though. Maybe someday I'll start carrying it again.