? [__] LOWERDASH BUG REPORTS (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
Creep into the Halloween / Horror Programming Contest (Deadline Extended)

[__] LOWERDASH BUG REPORTS

  • #1 ✎ 124 kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Hey Everyone! THIS IS THE OFFICIAL BUG REPORT THREAD FOR LOWERDASH Let me know if you run into any problems, glitches, or edge cases that my hackjob misses ;) KNOWN LIMITATIONS: - I didn't implement a heap. You can't delete. Good Luck. Version 0.3 BETA ----------------------------------------- Faster runtime at expense of slower constructor. Module Vars, Typed Members, Nil$, Parsing fixes. You can't use : as a line separator. Version 0.2 BETA ----------------------------------------- Initial release with hot off the stylus prototypal inheritance. Posted Edited by kldck_hul
  • #2 ✎ 111 raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Found another bug: If I declare a String that contains the character ":", then the text will split. This is in my code: MODULE RESLOAD STATIC DEF loadRes VAR S$="GRP4:SPRITES" LOAD S$,FALSE END Then when I execute the main, I got a syntax error. If I use LIST ERR, the error that is found is: ... VAR S$="GRP4 SPRITES" ... Also, a way to skip this bug is to use "GRP4"+CHR$(58)+"SPRITES" Posted Edited by raimondz
  • #3 ✎ 124 kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself I split the program at : to break it up into lines. I'll have to figure out some way to check if it occurs between "". That or I could just say not to use : , since it's not actually faster. Posted
  • #4 ✎ 111 raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself I found another bug in the new function. To explain the bug I will describe what i've done. I created an module A that contains a pool of object from module B. In the new method, I created a loop to instance all the object that I need in the pool. So it is like this: ======================================== Module A M->10 DIM POOL$[0] EXPORT DEF new() //var S$=me("") for i=0 TO M PUSH POOL$, CALL(new("B")) next return me("") //<---------------- END ... =========================================== The problem is that return me("") is returning the instance of B and not the instance of A. I managed to bypass this problem by storing the instance of A before the loop(with the line var S$ and then return S$). Unfortunately, I can't share the code and continue to post bug because I'm using other tool to manage my code. I decided to stop using lowerdash because I'm doing a bullet hell and the pool I've done didn't had a good performance. I made a pool of 20 instance and I had to use VSYNC 3 because the overhead of CALL _(myO$,"member") was noticeable when I used VSYNC with a value lower than 3. Posted Edited by raimondz
  • #5 ✎ 124 kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Did the constructor for Module B have a return statement? That should reset the stack... I'm curious what tool you switched to? I know about the CustomCompiler, but it only lets you namespace your code without objects, and its not just basic. I would say that using a heavyweight object for every bullet is bad idea. In this situation, I would switch to an entity system. EDIT: If you're not already doing it Your Module A would have a pool of numbers that correspond to sprites you've created. When something shoots a bullet, pop an id and store it in an active array as well as return it. You can pass the id to your setters. Your pool would then have an update/draw method that loops through the active numbers, doing what the individual update/draw method would have done. EDIT: One bullethell demo coming up Posted Edited by kldck_hul
  • #6 ✎ 111 raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Yes, the constructor b has a return statement at the end. I decides to use object for bullet because each one could have a different behavior and properties that wouldn't fit on the sprites variables. By the way, I'm using custom compiler. The only bad thing about this that there are bugs that doesn't allow the use of bit por hexa (Example: "&HFA") . Because sb3cc doesn't has object, I store the bullet's properties on arrays, each one storing a different property associated with the bullet "i". Posted
  • #7 ✎ 124 kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    Yes, the constructor b has a return statement at the end.
    I think I found a few edge cases where this might still cause a problem. I've changed a lot about the constructor for 0.3.
    I decides to use object for bullet because each one could have a different behavior and properties that wouldn't fit on the sprites variables.
    Do those properties and behaviors belong to the type of bullet. That is, each bullet of that given type is going to behave the same? You could have a module for each type of bullet and maintain lists very similar to how you are now:
    I store the bullet's properties on arrays, each one storing a different property associated with the bullet "i".
    Thats an entity system ;)
    By the way, I'm using custom compiler.
    Does using custom compiler offer anything over using vanilla modules from Lowerdash? I'm curious what I've got to play catch-up on :P EDIT: I guess I'm aware of the namespaced variables (var myVar --> myMod.myVar). This is something I want to add, but keeping the names consistent without parsing everything is an interesting problem.
    doesn't allow the use of bit por hexa
    Lowerdash 0.3 does ;)
    Posted Edited by kldck_hul
  • #8 ✎ 124 kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself 2 bugs I believe I were in the 0.4 release:
    1. ELSEIF gets parsed as an inline ELSE. Whoops!
    2. compile-time MEs are not finding STATIC DEFs. They can be picked up by the ME function at run-time, but this can't take arguments.
    Posted
  • #9 ✎ 111 raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself I found a bug with array creation. I'm working on a chunk system so I had this on the top of my map module MODULE MAP VAR M_CW=10 VAR M_CH=10 VAR SIZE=32 ' CHUNK SIZE VAR CHUNKS[ MAP_SIZE*MAP_SIZE*MAP_M_CW*MAP_M_CH] ... The code above work fine, but if I use pow for the size, then the code after the comma isn't written in slot 2. This is how it look on slot 2: ... VAR MAP_CHUNKS[ POW(MAP_SIZE COMMON DEF MAP_setCHUNKS V ... Posted
  • #10 ✎ 124 kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    I found a bug with array creation. I'm working on a chunk system so I had this on the top of my map module The code above work fine, but if I use pow for the size, then the code after the comma isn't written in slot 2
    This happens because the VAR statement is split at "," before parsing the rval. This is one of the few edge cases where Lex might come in handy. I'm considering rewriting the compiler in Regex; however I think the current parser is very workable, and this might be the only thing fixed. Edit: fixed. Also parsing might be REGEX not Lex. I'm using Lex for syntax highlighting, and both libraries are in the Lex download @.@
    Posted Edited by kldck_hul
  • #11 ✎ 124 kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself MAMORY LAKE MEMORY LEAK? The stack seems to be accumulating references, is this a new feature I added? If I throw an error in my game state (root scope), the stack has the player object bound to me. EDIT: I've greatly improved the debugging of errors like this in my hunt for this guy. I'm hoping a good dose of Prototype sugar will help too. EDIT2: I forgot to CALL my constructor... :P VAR P$ = CALL(new("Player")) oh gorsh Posted Edited by kldck_hul
  • #12 ✎ 124 kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself MEMs on prototypes get overwritten. DEF MOD____X() RETURN _Y[OFF[0]] End DEF PROTO____A() RETURN _Y[OFF[0]] END Offset needs to take size into account EDIT: I fixed this by creating a variable for modules with PROTO. This is one of the first mutable class values, I dunno if that's a problem. I guess how dumb are people? You can snoop through memory by adjusting this variable. EDIT: Back to being hard coded, so your Qbert high scores are safe! EDIT: new solution takes .0273 frames vs the .0271 if I use a variable. Every 10,000 variable getters take an extra 1/30th of a second. Is this even a problem? Posted Edited by kldck_hul
  • #13 ✎ 111 raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Hi, I tried to use array literal on lowerdash 0.65 but it display the following error: Member must be typed: VTYPE$[0] I tried to comment that line to see if that solve the problem but the message still appear but for the variable VID# This is a portion of the code from the module: MODULE LLAYOUT VERTICAL->0 HORIZONTAL->1 ´STATIC VARIABLE THAT STORE AL THE LINEAR LAYOUT INSTANCE VAR INS$[0] MEM X# MEM Y# MEM W# MEM H# MEM ORIENT# ´VARIABLE USED TO STORE THE VIEWS. MEM VTYPE$[0] MEM VID#[0] STATIC DEF init_ INS$=malloc1("TXT",0) END EXPORT DEF new() PUSH LLAYOUT_INS$,me("") END ... Posted
  • #14 ✎ 124 kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    Hi, I tried to use array literal on lowerdash 0.65 but it display the following error: Member must be typed: VTYPE$[0]
    Unfortunately, members cannot be arrays. This is a limitation to the memory system. Inserting a new array clears the memory for the slot it is added to. So with any number of instances being created and destroyed, its impossible to do this in a safe way. I solved this in Sprint by building a linked list. Its surprisingly faster than I expected, but its no array. Potentially, this could be a feature where you specify the upper limit on the number of instances that will be created. That way all arrays exists for the duration of the program, and the memory will never get cleared. What are your thoughts on this approach? EDIT: P.S: Array literals are used in VAR statements. (as a literal representation of the data) VAR VTYPE$[] = ["my", "list", "of", "types"]
    Posted Edited by kldck_hul
  • #15 ✎ 111 raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Ok, I misread what you wrote about array literals(I thought that it was to create array on objects but then I realized that it was the syntax to create an instance of a static array in a single line) I think that the linked list is a good solution but first I will try the aproach that is used in database to do one to many relationship: I will store the id of the parent in the view pool instead of storing an array(or list) of childs. Maybe I could do a benchmark to see wich option could be better. I don't like the idea of array that couldn't be destroyed because that will create a memory leak. Posted Edited by raimondz
  • #16 ✎ 111 raimondz First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself I don't know if I did something wrong but the compile_lib function doesn't work correctly. I put compile_lib before hend but it generate a file with 4 lines. Here is my code: R534733E (It's a library to handle UI). The .main file contains all the imports. Posted
  • #17 ✎ 1261 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS This code was generated by the lowerdash compiler: COMMON DEF EDITORC(K$) K$="@"+K$ IF !CHKLABEL(K$) THEN RETURN Nil$ GOSUB K$ @ALIGN_LEFT:RETURN 0 @ALIGN_CENTER:RETURN 1 @ALIGN_RIGHT:RETURN 2 @I_NL:RETURN CHR$(10) @I_NLK:RETURN CHR$(13) @I_ER:RETURN CHR$(8) END That GOSUB should be GOTO, otherwise this doesn't work in 3.5.2 due to a change in the way RETURN works. (And in earlier versions, this still causes memory leaks) Posted Edited by 12Me21