Howdy, Stranger!

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

Categories

Out of String Space in the EXE file?

Dr. COM WIZDr. COM WIZ Member Posts: 74
Hello, World!

This is Dr. COM WIZ. It has been a while hasn't it? The truth is, I've been on and off of programming because of all the many things I like to do. Well, anyway, here is my request.

I am in the middle of mass game development (what a surprise :-) ). I'm trying to complete a *good* game with no libraries and no external files; just pure flat out code. This will improve portablilty and prove to me I can do it without the above luxuries.

The fact that I am making this kind of game without external files is rare and brave (or alteast I think so). As brave as I am being, I am sure to run into a lot of problems. So I have, but was able to overcome them after stressfull days and sleepless nights.

However, one problem is really, really bugging me. I had to sacrifice some optimizations to fix it, and now it's back. What is it? Well, the game development can be going very well, so I compile it. When I open the compiled program, I sometimes wouldn't even get as far as the title screen! I thought that my problems in the program would be pointed out BEFORE it is compiled. This is also strange because when I run it uncompiled, it works just fine! That's dumb!

I really need some insight on why my program doesn't work. Please, please help me. Here are some of the problems I have faced.
(the dashes stand for numbers that I don't remember)

Error messages:
Out of memory in module GAME at address ---:---
Out of string space in module GAME at address ---:---

Right now, I am experiencing the latter. The game reaches as far as the menu. When the first level loads, that's it.

If you want to see code, I don't think all of it will fit here. There is A LOT (and that's probably what the problem is), about 101KB. I can e-mail it to you, if you would like to help.


This has been,
Dr. COM WIZ
PS Thank you and goodnight!

Comments

  • DymanicDymanic Member Posts: 63
    : Hello, World!
    :
    : This is Dr. COM WIZ. It has been a while hasn't it? The truth is, I've been on and off of programming because of all the many things I like to do. Well, anyway, here is my request.
    :
    : I am in the middle of mass game development (what a surprise :-) ). I'm trying to complete a *good* game with no libraries and no external files; just pure flat out code. This will improve portablilty and prove to me I can do it without the above luxuries.
    :
    : The fact that I am making this kind of game without external files is rare and brave (or alteast I think so). As brave as I am being, I am sure to run into a lot of problems. So I have, but was able to overcome them after stressfull days and sleepless nights.

    :
    : However, one problem is really, really bugging me. I had to sacrifice some optimizations to fix it, and now it's back. What is it? Well, the game development can be going very well, so I compile it. When I open the compiled program, I sometimes wouldn't even get as far as the title screen! I thought that my problems in the program would be pointed out BEFORE it is compiled. This is also strange because when I run it uncompiled, it works just fine! That's dumb!
    :
    : I really need some insight on why my program doesn't work. Please, please help me. Here are some of the problems I have faced.
    : (the dashes stand for numbers that I don't remember)
    :
    : Error messages:
    : Out of memory in module GAME at address ---:---
    : Out of string space in module GAME at address ---:---
    :
    : Right now, I am experiencing the latter. The game reaches as far as the menu. When the first level loads, that's it.
    :
    : If you want to see code, I don't think all of it will fit here. There is A LOT (and that's probably what the problem is), about 101KB. I can e-mail it to you, if you would like to help.
    :
    :
    : This has been,
    : Dr. COM WIZ
    : PS Thank you and goodnight!
    :

    I can't be a specific as I'd like to without looking in HELP (which I can't do from this computer), but your problem has to do with the use of near, as opposed to far, strings. You have to set the compiler options for this.

  • DymanicDymanic Member Posts: 63
    On closer examination, re the first part of your problem (out of memory): If the thing was 101k, as a single module it wouldn't even have loaded in the IDE, much less run, so I'm confused about how it could have run interpreted. You'll have to either trim it back or modularize it...64k is all you get.
  • Dr. COM WIZDr. COM WIZ Member Posts: 74
    : On closer examination, re the first part of your problem (out of memory): If the thing was 101k, as a single module it wouldn't even have loaded in the IDE, much less run, so I'm confused about how it could have run interpreted. You'll have to either trim it back or modularize it...64k is all you get.

    :Thank you very much for that suggestion. However, I already know that 64k is the limit. Therfore, my program is set into modules. My problem was that I tried to create the game with as few SUBs as possible. However, just yesterday (after I fixed the string problem), I could add no more code to my main module; I had reached the limit and got an OUT OF MEMORY error every time I tried to type something new. This was due to the fact that all my graphics were produced with DATA statements. Each graphic was 16 lines, and I had about 30 different graphics (maybe more).


    The solution? I had to move my whole game loop into a different SUB. If you count that SUB and all the ones I made before, I now have atleast 25 SUBs, the amount for a typical good QB game. That's pretty much considering the fact that I wanted this project to have as few as possible.


    This has been,
    Dr. COM WIZ
    PS Thank you and goodnight!

  • Dr. COM WIZDr. COM WIZ Member Posts: 74
    : : Hello, World!
    : :
    : : This is Dr. COM WIZ. It has been a while hasn't it? The truth is, I've been on and off of programming because of all the many things I like to do. Well, anyway, here is my request.
    : :
    : : I am in the middle of mass game development (what a surprise :-) ). I'm trying to complete a *good* game with no libraries and no external files; just pure flat out code. This will improve portablilty and prove to me I can do it without the above luxuries.
    : :
    : : The fact that I am making this kind of game without external files is rare and brave (or alteast I think so). As brave as I am being, I am sure to run into a lot of problems. So I have, but was able to overcome them after stressfull days and sleepless nights.
    :
    : :
    : : However, one problem is really, really bugging me. I had to sacrifice some optimizations to fix it, and now it's back. What is it? Well, the game development can be going very well, so I compile it. When I open the compiled program, I sometimes wouldn't even get as far as the title screen! I thought that my problems in the program would be pointed out BEFORE it is compiled. This is also strange because when I run it uncompiled, it works just fine! That's dumb!
    : :
    : : I really need some insight on why my program doesn't work. Please, please help me. Here are some of the problems I have faced.
    : : (the dashes stand for numbers that I don't remember)
    : :
    : : Error messages:
    : : Out of memory in module GAME at address ---:---
    : : Out of string space in module GAME at address ---:---
    : :
    : : Right now, I am experiencing the latter. The game reaches as far as the menu. When the first level loads, that's it.
    : :
    : : If you want to see code, I don't think all of it will fit here. There is A LOT (and that's probably what the problem is), about 101KB. I can e-mail it to you, if you would like to help.
    : :
    : :
    : : This has been,
    : : Dr. COM WIZ
    : : PS Thank you and goodnight!
    : :
    :
    : I can't be a specific as I'd like to without looking in HELP (which I can't do from this computer), but your problem has to do with the use of near, as opposed to far, strings. You have to set the compiler options for this.
    :
    :
    Hello, Dynamic!

    This is Dr. COM WIZ. I already fixed the problem. Thank you for your concern, though. The problem, basically, was that I had an uneccessary map that required a whole different string array. The map itself was needed for the game, but I didn't have to use a whole other string array for it. So, I used the same array as all the levels and that just kicked the problem away.

    However, I couldn't find the option you were talking. I am using QuickBasic 4.5 for the project. Are you refering to a feature in QuickBasic 7.1? I have that compler, too, and I will try to find the option you were talking about.

    By the way, by my making this game project with no external files, I am really learning a lot more about QBasic and learning new ways to solve general programming problems. When I relase the game, you will see how well a game programmer I have come to be.
    This has been,
    Dr. COM WIZ
    PS Thank you and goodnight!

  • mstechcamstechca Member Posts: 64
    You probably declared some variables as strings or you used arrays.

    Look for dim whatever as string * number
    Make the "number" smaller.

    also, in your arrays, make the numbers in brackets smaller.

    Try adding DEFINT A-Z at the top of your subroutines.
    Use the '$dynamic metacommand at the top of yor program.

    If you get string space corrupt, then you might be using corrupt assembly code in your program or you are using the wrong keywords, for example, you are using SADD() when you must use VARPTR()
  • Andre YoungAndre Young USAMember Posts: 0

    _______ // http://forcoder.org // free video tutorials and ebooks about / Perl, MATLAB, C, Objective-C, R, Visual Basic, PHP, C++, Java, PL/SQL, Delphi, Assembly, Visual Basic .NET, Python, Scratch, Ruby, Go, Swift, C#, JavaScript Ada, ABAP, VBScript, Julia, Prolog, Scala, Scheme, Crystal, Rust, Alice, Kotlin, Awk, COBOL, Lua, Fortran, ML, F#, Apex, Dart, Logo, Hack, Clojure, Lisp, Transact-SQL, Erlang, SAS, LabVIEW, FoxPro, Bash, D / _______

Sign In or Register to comment.