Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 22 Oct 2008
Offline Last Active Apr 14 2016 05:50 PM

Posts I've Made

In Topic: Can I use humanmake models in my game for commercial purpose?

01 November 2014 - 08:36 AM

According to their website, you can use any assets you create in commercial and non-commercial products. The only exception is the source code. Short answer is yes.

In Topic: GOTO, why are you adverse to using it

07 September 2014 - 08:38 PM

Yes, I'm over using goto according to pro standards but not my standards. I know I will never work in the professional arena (only happened once using c#) so I program the way I'm most comfortable with. The code you saw (which I shouldn't have posted) is simply copy/paste for each type of section. It can parse over 900 files in less than 4 seconds, the cache hits are negligible unless someone really has a trashy INI file. I make sure mine are clean and jump back to lp:. What I posted is at the top of the routine and is fully in the cache, even the subroutines.

I don't create a new function unless it's used more than once.

Anyways the question I asked in the OP has been fully answered, I will never make it in the pro world with my programming style. Cudos to those who posted before i got switched forums. this should have been left in the GDNet lounge. 

In Topic: GOTO, why are you adverse to using it

06 September 2014 - 09:17 PM

@iMalc, I live in an area of the country where Fortran, Cobol and C programmers are in high demand lol, sorry c++ is the lowest I'm willing to go. Will do c# if needed for a tool but it isn't needed around here. At work our OS is Win 98, no thanks, I left VS 6 many years ago...

In Topic: GOTO, why are you adverse to using it

06 September 2014 - 08:23 PM

I could see where a boolean would work in that case. Anyways most of my code isn't written that way, I uses lots of if statements, for loops, breaks and continues where applicable, subroutines, returns etc. Just wondering, I don't know of any statement besides goto that could be used to break out of an if statement.


I could understand that you would quit if you had to work on my code, the example I gave was the most extreme use of it in my code, The naming though I have no trouble with, been using the same short style names for over 20 years, consistency counts a lot. If I don't remember it I say it out loud then it pops into my head, I did just take a year long break from programming of any sort and when I went back to it I had no trouble reading it. I didn't post the whole routine either but it is just test after test like that. It's fast, cache friendly and very stable.


Another thing I do is for loops, i,li, j,lj, k,lk, most would give them names, I don't. I start at i and go through the alphabet. i is the loop counter and li is limit counter, always a pair, always in order. I did a little research on RAII and it seems I have been programming my routines that way for a long time, albeit manually, since I use all custom memory handlers and reference counting. They all handle their own cleanup on exit as well, fairly easy to do with classes.


Now when it comes to routine names, those are usually fully spelled out except Rem(ove). I have a class template I use for every new class and a program to create it for me. I just name the parts and it spits out a new class ready to plug in. Takes less than a minute to have a fully functional dynamic memory/rendering class to use.



Wanted to show what I mean about being fast, click on my youtube link below and watch the wandering video, 5% is INI parsing, 95% is DX loading the data. Most of the textures it loads is 1024 x 1024. I will switch to streaming eventually but this will show you that the bottleneck is not the spaghetti code I posted.

In Topic: GOTO, why are you adverse to using it

06 September 2014 - 07:06 PM

Thats just an example, I don't know beforehand how long the script is in line count. Goto unknown command is there since if rv=false then that is a command that isn't part of that section. If rv=true then it was a valid line so go parse the next line. For ex. if a model had a range attribute (part of the light section) it is an invalid command and should be logged as such.


The end of script test is done by this line...

if(DBFIO.IsPastEOS()==true) goto ex;


The read_line(something) won't work since spl is an array, it's the line split into individual items, the command and all of it's parameters. It also has no return value other than split line (spl). The way it works is it checks for a valid section header such as [light], if it isn't that it continues parsing the individual lines of the current section till it hits another header.


As far as sensible names, they make perfect sense to me, short and descriptive. Less typing as well. Yep, it comes from my background in assembly. The names could be up to 255 characters back then though. Like I said, I'm set in my ways and one of them is short names. DynObj is a dynamic object model loaded from a script. For the naming, notice each word starts with a capital, ie Cur(rent) L(i)n(e)C(ou)nt, usually vowels are dropped. Also, I'm the only one who will ever work on the code and won't be releasing it. That code is quite legible compared to some of the legacy code still hanging around in my core library.


Anyways any other methods are welcome, always up for learning new things....