Cfx Games Slow, New Drawing Method
#1
Posted 12 March 2005 - 01:16 AM
for example:
This program will make a star move around screen using direction buttons(could be replaced with a man to make a rpg like game?):
ViewWindow 1,127,0,63,1,0
FuncOff
S-WindMan
S-Gph1 DrawOn,xyline,list1,list2,1,Dot
{2,10,18,1,19,1}->List 1
{19,1,19,7,7,19}->List 2
-60->A:-28->B
Lbl 0
Getkey
Ans=0=>Goto 0
Ans=38=>A+10->A
Ans=27=>A-10->A
Ans=37=>B-10->B
Ans=28=>B-10->B
ViewWindow 1+A,127+A,0,63+B,1+B,0
DrawStat
Goto 0
If u try this out you will definatly see the advantage over F-line commands.
Its fast enougth that you wont even see the lines being drawn, they just appear
Using the method above, u dont even have to manipilate the list data as you just change the view-window parameters to move the object across the screen. This could be put to use in moving backgrounds made up of lines, or just simple sprites like a star or man.
If u want u can also do this by manipuilating the list data and not the view-window, but this will slow down as you get images/sprites made up of lots of points, so changing the view-window parameters is best for speed .
An example of the advantage of this method would be to draw a background/map using this, then store it as background pict, then have a man/car/whatever move around the screen using the view-window method like above. You could even rotate the man/car/whatever by manipulating the lists with polar and rec commands.
So it would be cool if authors of cfx games now use this method, or update their games so the drawing is faster.
Another note, if you want to zoom backgrounds or sprites bigger and smaller or squash or stretch them, u can edit the viewwindow parameters, then drawstat which is very fast.
Another note, dont open the programs up in casiocomm as it doesnt recognise all the commands like S-Gph1 DrawOn,xyline,list1,list2,1,Dot, so it stuffs them up when u try to send them too ur calc. Ull have to transmit it with, but not open it for text editing in casio comm.
- Viliami and frankmar98 like this
#2
Posted 12 March 2005 - 02:57 AM
#3
Posted 12 March 2005 - 05:50 AM
i agree with you though, it is a much faster way to draw things.
#4
Posted 12 March 2005 - 09:43 AM
I've never used this in my CFX games cause I'd not know about this feature. It works really good though (if I had used it in Forumula 1 for example it would have been a much faster game as this uses much F-Lines).
Btw you can't form shapes only with each line conntected to the next (such as stars), but you also can "deposit the pen" when plotting a point somewhere outside the ViewWin and again plotting inside then. Example (view window is -6.3,6.3,1,-3.1,3.1,1):
{6,6,-6,-6,100,0,2}->List 1 {3,-3,-3,3,100,0,2}->List 2
#5
Posted 12 March 2005 - 12:48 PM
#6
Posted 12 March 2005 - 10:07 PM
Even with big lists it does get slower but is still way faster, but only if u move the sprite with viewwindow.
But lets face it, about 99% of ppl have never used this technique, so i think it needed some publicity, especially when ure playing gmaes like mario(no offence, good game) and it takes 2 mins for the map to load.
CORRECTION: not mario, i think it was FF7, but the trees looked like the ones on mario.
#7
Posted 13 March 2005 - 05:09 AM
that way you can place a sprite anywhere on the screen (you can even resize it by multiplying)
#8
Posted 13 March 2005 - 08:21 PM
But if u dont want to use a background pict then manipulating the lists is the only way.
Also re-sizing or stretching/squashing sprites is fast by changing V-win, once agin u dont have to manipulate any list data
But the only thing is that V-win can get confusing when placing objects on screen, so u have to spend a while working out the maths of how its going to work out.
#9
Posted 14 March 2005 - 12:34 AM
#10
Posted 14 March 2005 - 11:50 AM
For example, some CFX models (i don't remember the english names, but its Graph30/Graph35 in French) clear the screen before doing the drawstat. That means that if you have different things to show on screen, you have to save the picture first, then use it as a background and then call DrawStat. And on these models, there are only 6 pictures available.
Another thing: on the AFX the F-Line command is quite faster than on CFX models. However, on AFX using the lists is quite slower! The conclusion is that this is sometimes faster to use F-Line than DrawStat on AFX.
Plus, like Marco said it is actually possible to draw discontinous graphics by placing plots outside the view window. This is true for all CFX models. Otherwhise on the AFX a line will be partially drawn to this point, and you have to place it far away of the screen to avoid it.
Thus, the main problem is essentialy a question of compatibility between the different models, that you don't have with the F-Line command. It is not such a big deal, but you must stay aware of that though.
Btw, i agree it is a cool trick, and i was using it everytimes for my CFX progs
Oh and I just found an old french tutorial about it. When this has been written, the technic was already in use for a year or 2. Here it is: http://www.casioland...topic.php?t=662
I was also looking for one of the very first games that was using drawstat for graphics, but couldn't find it on the web I will check my hard disk to find my own copy.
#11 Guest_Guest_*
Posted 15 March 2005 - 02:03 AM
I don't really understand it
Is it any thing like Ion for Ti Calculators???
#12
Posted 15 March 2005 - 04:07 AM
MLC is a programming language, like BASIC or ASM, it comes with a Shell (like Ion) but MLC is not like Ion. with MLC you can program a game and everyone with MLC on their calculator can play your game, no matter what calculator they have.
#13 Guest_Guest_*
Posted 15 March 2005 - 07:13 AM
It's just that this forum had the most recent post so i figured people might answer my question quicker
Thanks for the help
#14
Posted 15 March 2005 - 06:36 PM
I repeat myself - thanks for the tip!
#15
Posted 15 March 2005 - 10:21 PM
S-WindMan
S-Gph1 DrawOn,xyline,list1,list2,1,Dot
could you explain these lines to me...I feel like such a newb
#16
Posted 15 March 2005 - 11:14 PM
DrawOn: "Draw"->"On" (F1' /> F1' />)
xyLine: "Grph"->"xy" (F2' /> F5' />)
list1/2: "List" (F3' />)
Dot: "Mark"->"." (F4' /> F3' />)
S-Gph1: "Grph"->"Gph1" (F1' /> F2' />)
S-WindMan by "Setup" -> ">" -> ">" -> "S-Win" -> "Man" (Shift' /> MENU' /> F6' /> F6' /> F3' /> F2' />)
#17
Posted 16 March 2005 - 07:31 AM
S-Gph1 is for defining parameters of the first StatGraph
DrawOn to activate the drawing of the StatGraph
xyline to say that you want connected points (xyLine graph)
list1 is the list containing the x-coordinates of your points
list2 is the list containing the y-coordinates of your points
1 is the frenquency of your data, as you want only one point at each coordinate, you enter 1 (you can also enter a list of size = number of points, it can be useful in other stat graphics)
Dot is the symbol placed at each point (dot for a dot, square for a square and cross for.... ... a cross lol)
#18
Posted 17 March 2005 - 12:44 AM
#19
Posted 17 March 2005 - 02:08 AM
#20
Posted 17 March 2005 - 02:18 AM
#21
Posted 17 March 2005 - 03:30 AM
#22
Posted 17 March 2005 - 07:23 AM
Now when u want to draw a different sprite u just change to the correct list file and lists for the S-Graph command eg say u r using a sprite in file 1, lists 1and2,,,,,,and u want too draw another that is in file3 lists 5and6:
Back-Pict 1
File1
S-Graph1 drawon,xyline,list1,list2
Viewwindow (wherever u want sprite to be placed)
Drawstat
StoPict 1
File3
S-Graph1 drawon,xyline,list5,list6
Viewwindow (wherever u want sprite to be placed)
Drawstat
(i know i have written sum commands above wrong, but u know what ones i mean, i just cant be stuffed looking them up in my calc)
As u can see, this is faster than loading in whole lists for different sprites.
This opens options for graphics engines in ur game that loads tiles and maps and sprites.
#23
Posted 31 March 2005 - 08:09 PM
{5,6,6,5,6,6,4,3,2,1,1,2,2,1,1,4,6,8,7,7,8,10,10,11,12,14,11,9,11,13,13,14,15,15
,14,12,11,12,13,12,14,14,15,15,13,12,12,11,10,10,8,9,8,8,9,8,9,8,8,7,7,9}->List 1
{7,8,10,11,12,13,13,12,12,11,10,9,8,7,5,2,2,4,5,7,8,6,7,7,6,6,3,3,3,5,7,8,7,10,1
1,9,9,9,10,11,11,13,14,15,15,14,13,12,13,14,12,11,10,9,9,10,11,12,13,14,15,15}->List 2
This spirit gets terribly "ugly"when I incrase the sice of it..
..incrased it by adding this below "Ans=28=>B-10->B":
If Ans=31
Then List 1*2->List 1
List 2*2->List 2
IfEnd
This is realy perfect for me .. all the cordinates for the hundred rpg enemies can be stored in a huge mat table and just loaded to the List every time I need'em, the only bad thing is that I'll use 4 enemies and each of'em need 2 lists , but .. is it possible to draw diffrendt colors, like drawing the whole thing in red/green? because I would realy like to draw backgrounds in several colors..
#24
Posted 31 March 2005 - 09:14 PM
the corresponding drawstat will be drawn in orange
same for blue and green
so you must separate the colors in different lists
#25
Posted 01 April 2005 - 10:10 AM
#26
Posted 01 April 2005 - 10:13 AM
#27
Posted 01 April 2005 - 06:22 PM
#28
Posted 09 April 2005 - 09:10 PM
#29
Posted 26 June 2006 - 03:25 AM
... also, untill recently i hadn't realized that you could keep it from displaying that "StatGraph 1" thing at the top of the screen every time, which would have made games really anoying.
Eh.. but how do you achieve that then?
#30
Posted 26 June 2006 - 06:10 AM
#31
Posted 26 June 2006 - 11:25 AM
Hmm... FuncOff doesn't seem to have any effect on the "StatGraph1" title on my 9950. Weird.That is on/of by turn on/of the func in setup menu.
#32
Posted 27 June 2006 - 03:33 PM
I'm considering making a faster version of GLLINE from Casio OpenGL (or whatever I should name the API). And making a FPS game with StatGraph1 in the corner might be a nice advert for studying statistics (and your teacher might think it is a legitimate game you're working on ) but it is just so very ugly.
#33
Posted 29 June 2006 - 08:11 AM
1 most people who learn to program doing in there free time in highschool
- and most people who program do upper maths, (intro caculus, geometery an triginometry)
- using stats mode is a very much a lower math technique, (modeling with maths, foundations)
- so the first inclination of a upper math student is to use linear formulaes with limmits eg Y=2x, [3,4], f-line is faster and easier than this so when they discover it they use it.
2 alot of programers put more thought in to minmising memory usage, f-line is much more efficent.
well thats how it is to me
#34
Posted 29 June 2006 - 08:33 AM
I don't really agree with that.2 alot of programers put more thought in to minmising memory usage, f-line is much more efficent.
Actually F-Line uses more memory than DrawStat, simply because you have to write every coordinates in the program, and repeat each point for large pictures. With DrawStat in most of the cases you just have to write each point once. Example:
F-Line x1,y1,x2,y2 F-Line x2,y2,x3,y3 F-Line x3,y3,x4,y4 F-Line x4,y4,x5,y5 ...instead of
{x1,x2,x3,x4,x5, ...}->List 1 {y1,y2,y3,y4,y5, ...}->List 2and there is no real need to let the lists in memory when the DrawStat has been done, thus they don't require a lot more free space
Another important advantage of DrawStat is flexibility. With F-Line you should generally know how many lines you need to draw (or you have to use some loops and lists to iterate over the points). With DrawStat, you just have to create 2 lists (dynamicaly or not), and it will draw the content.
And from my point of view, I'm sure people don't use it simply because they never saw/knew/thought about it. I was a big user of that method before, but I think I would never have used it if someone else never showed it to me
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users