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"
[__] LOWERDASH BUG REPORTS
Root / Talk About Programs / [.]
kldck_hulCreated:
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.
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.
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
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".
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 hexaLowerdash 0.3 does ;)
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 ...
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 2This 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 @.@
VAR P$ = CALL(new("Player"))oh gorsh
MEMs on prototypes get overwritten.
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?
DEF MOD____X() RETURN _Y[OFF[0]] End
DEF PROTO____A() RETURN _Y[OFF[0]] ENDOffset needs to take size into account EDIT: I fixed this
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 ...
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"]
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.
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) ENDThat 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)
Everything crashes on my 3DS...