320x200 RPG Game : Textprinting

As I begin I would like to mention that i'm very precice about my code, I do not like to use other peoples code nor basic functions like printf or scanf, It just does not feel right :) as you may have figured i'm learning ASM to do all the work by myself.


Ok, now that's settled, I have a problem with my RPG game, I want to display different formats with my textprinting function like integers, chars or floats as printf does, but what I can't understand is how to skip an argument in a function.


Do I really need to do this ?


Other tips would be highly appreciated.


If you are more interested about the (game) project or have any suggestions, please mail me and I can send you a plan-file.


PS. Just a little psychological question, should I have that constant fear I have about not writing the most general code I can ? I mean, I could never create a game which has functions to draw an sprite directly to a buffer, no no no, I gotta have a screen struct that holds the buffer and all it's information, is this good or bad when you are making a game ? :/




Have a nice day!




/ pelle


Comments

  • You want to make game by yourself?

    then just dive in!

    have a plan and start writing code

    believe me ... just code it !

    and use those functions available

    you dont have time to create and understand them all

    you might lost your interest to finish your game by the time you understand them

    Its ok to be curious and want to code few functions by yourself but dont carried away


    -= S =-



    : As I begin I would like to mention that i'm very precice about my code, I do not like to use other peoples code nor basic functions like printf or scanf, It just does not feel right :) as you may have figured i'm learning ASM to do all the work by myself.


    : Ok, now that's settled, I have a problem with my RPG game, I want to display different formats with my textprinting function like integers, chars or floats as printf does, but what I can't understand is how to skip an argument in a function.


    : Do I really need to do this ?


    : Other tips would be highly appreciated.


    : If you are more interested about the (game) project or have any suggestions, please mail me and I can send you a plan-file.


    : PS. Just a little psychological question, should I have that constant fear I have about not writing the most general code I can ? I mean, I could never create a game which has functions to draw an sprite directly to a buffer, no no no, I gotta have a screen struct that holds the buffer and all it's information, is this good or bad when you are making a game ? :/


    :

    : Have a nice day!


    :

    : / pelle





  • Thanks for the tip, well, maybe I could get some sort of graphic library for the texthandling.


    / pelle


  • Here's the problem with the way you're programming:


    #1) No portability. By making all your functions in pure assembly, without even the most base functions like printf() you are creating programs simply for one platform. This will prove to be problematic if you wish to port your program to another OS or CPU instruction set.


    #2) Feel right or not, you're just making extra work for yourself. Assembly code is not easy to learn, and unless you are an extremely good assembly programmer, you're not going to get much more benefit out of programming in assembly over a language like C/C++. This links back to portability, the ONLY reason anyone should write their own assembly code for anything is to optimize the speed of their code. Assembly is the last alternative for speeding up code because if you're programming in assembly, your code is effectively un-portable.


    For standard functions like printf() and others, you should have no qualms about using them. If you don't like using external libraries like Allegro and want to program your own graphics routines, that's different. One should *never* pride themselves in doing unnecessary work.


    -Xotor-


    : As I begin I would like to mention that i'm very precice about my code, I do not like to use other peoples code nor basic functions like printf or scanf, It just does not feel right :) as you may have figured i'm learning ASM to do all the work by myself.


    : Ok, now that's settled, I have a problem with my RPG game, I want to display different formats with my textprinting function like integers, chars or floats as printf does, but what I can't understand is how to skip an argument in a function.


    : Do I really need to do this ?


    : Other tips would be highly appreciated.


    : If you are more interested about the (game) project or have any suggestions, please mail me and I can send you a plan-file.


    : PS. Just a little psychological question, should I have that constant fear I have about not writing the most general code I can ? I mean, I could never create a game which has functions to draw an sprite directly to a buffer, no no no, I gotta have a screen struct that holds the buffer and all it's information, is this good or bad when you are making a game ? :/


    :

    : Have a nice day!


    :

    : / pelle





  • Ok, I'll keep that in mind!




    / pelle


  • If you don't mind doing a little hacking, I have a graphics lib written for non protected mode 13h. Lots of the funtions would work without any changes, like the 3d math ones, and the rest shouldn't be to hard to get to work. But Allegro is better, I just kinda like you, but not quite bad enough to write my own printf!


    : Thanks for the tip, well, maybe I could get some sort of graphic library for the texthandling.


    : / pelle





  • Sure thing, send it to me so that I could have a look at it. Thanks in advance!




    / pelle


  • I disagree with a bit of that, the no benefit part... for time intensive functions, assembly is the king, even if you are only a decent programmer, you can get a 5-10% increase, plus, you can get a good assembly programming book, and learn how to arrange your assembly code so that it goes nearly twice as fast on a pentium... While many c compilers, have 'pentium optimization', none of it is really very good, at least when compared to a decent assembly programmer that knows many of the tricks.

    But, I would have to agree with the No Portability part... Assembly is a pain in the neck to port, so C or another high level language is the best way to go...

    : Here's the problem with the way you're programming:


    : #1) No portability. By making all your functions in pure assembly, without even the most base functions like printf() you are creating programs simply for one platform. This will prove to be problematic if you wish to port your program to another OS or CPU instruction set.


    : #2) Feel right or not, you're just making extra work for yourself. Assembly code is not easy to learn, and unless you are an extremely good assembly programmer, you're not going to get much more benefit out of programming in assembly over a language like C/C++. This links back to portability, the ONLY reason anyone should write their own assembly code for anything is to optimize the speed of their code. Assembly is the last alternative for speeding up code because if you're programming in assembly, your code is effectively un-portable.


    : For standard functions like printf() and others, you should have no qualms about using them. If you don't like using external libraries like Allegro and want to program your own graphics routines, that's different. One should *never* pride themselves in doing unnecessary work.


    : -Xotor-


    : : As I begin I would like to mention that i'm very precice about my code, I do not like to use other peoples code nor basic functions like printf or scanf, It just does not feel right :) as you may have figured i'm learning ASM to do all the work by myself.


    : : Ok, now that's settled, I have a problem with my RPG game, I want to display different formats with my textprinting function like integers, chars or floats as printf does, but what I can't understand is how to skip an argument in a function.


    : : Do I really need to do this ?


    : : Other tips would be highly appreciated.


    : : If you are more interested about the (game) project or have any suggestions, please mail me and I can send you a plan-file.


    : : PS. Just a little psychological question, should I have that constant fear I have about not writing the most general code I can ? I mean, I could never create a game which has functions to draw an sprite directly to a buffer, no no no, I gotta have a screen struct that holds the buffer and all it's information, is this good or bad when you are making a game ? :/


    : :

    : : Have a nice day!


    : :

    : : / pelle





  • Oh yeah it will speed up your programming, hell, emulators like ZSNES are made entirely out of assembly and they emulate full processors.


    But writing assembly for such simple functions like printf() is just not worth the hassel, especially just for the reason that it doesn't "feel right."


    -Xotor-


    : I disagree with a bit of that, the no benefit part... for time intensive functions, assembly is the king, even if you are only a decent programmer, you can get a 5-10% increase, plus, you can get a good assembly programming book, and learn how to arrange your assembly code so that it goes nearly twice as fast on a pentium... While many c compilers, have 'pentium optimization', none of it is really very good, at least when compared to a decent assembly programmer that knows many of the tricks.

    : But, I would have to agree with the No Portability part... Assembly is a pain in the neck to port, so C or another high level language is the best way to go...

    : : Here's the problem with the way you're programming:


    : : #1) No portability. By making all your functions in pure assembly, without even the most base functions like printf() you are creating programs simply for one platform. This will prove to be problematic if you wish to port your program to another OS or CPU instruction set.


    : : #2) Feel right or not, you're just making extra work for yourself. Assembly code is not easy to learn, and unless you are an extremely good assembly programmer, you're not going to get much more benefit out of programming in assembly over a language like C/C++. This links back to portability, the ONLY reason anyone should write their own assembly code for anything is to optimize the speed of their code. Assembly is the last alternative for speeding up code because if you're programming in assembly, your code is effectively un-portable.


    : : For standard functions like printf() and others, you should have no qualms about using them. If you don't like using external libraries like Allegro and want to program your own graphics routines, that's different. One should *never* pride themselves in doing unnecessary work.


    : : -Xotor-


    : : : As I begin I would like to mention that i'm very precice about my code, I do not like to use other peoples code nor basic functions like printf or scanf, It just does not feel right :) as you may have figured i'm learning ASM to do all the work by myself.


    : : : Ok, now that's settled, I have a problem with my RPG game, I want to display different formats with my textprinting function like integers, chars or floats as printf does, but what I can't understand is how to skip an argument in a function.


    : : : Do I really need to do this ?


    : : : Other tips would be highly appreciated.


    : : : If you are more interested about the (game) project or have any suggestions, please mail me and I can send you a plan-file.


    : : : PS. Just a little psychological question, should I have that constant fear I have about not writing the most general code I can ? I mean, I could never create a game which has functions to draw an sprite directly to a buffer, no no no, I gotta have a screen struct that holds the buffer and all it's information, is this good or bad when you are making a game ? :/


    : : :

    : : : Have a nice day!


    : : :

    : : : / pelle





Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories