? SIM.3D ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

SIM.3D

Submitted
Updated
Author
Simeon
Public Key
HEAEP3
Min. Compat.
All
Version
1.5
Size
90.4KB
Rating
30 votes
Description

A lightweight yet powerful 3D game engine

Instructions

What's New

_____________________

Version 1.5 - The physics update

  1. Although only bounding box physics are currently supported, it has been implemented in such a way that more complex shapes will soon be supported.
  2. Many performance improvements
  3. Now supports split-screen gameplay as well as quadruple-screen gameplay. Using two or four screens does not noticably change the overall framerate!
  4. Added the ability to merge objects into one, and split them (MERGEOBJ,SPLITOBJ).
  5. Added object bounding box variables (OBJMINX,Y,Z,OBJMAXX,Y,Z).
  6. An object's center is not longer its center of mass, but rather the center of its bounding box.
  7. Added a wireframe cube object (called WCUBE) as well as UPDATEWCUBETOOBJ to set the wireframe position ans size to match another object's bounding box.
  8. Added CHECKCOLLISION to check every object in the world to check for collisions.
  9. Added ISCOLLIDING to check if two objects are intersecting.
  10. Added RAYTHROUGHOBJ to check if an infinite ray is intersecting an object.
  11. Added COLOROBJAB function to color a specific range of triangles in an object.
  12. Added a FLAG object (the main character of 3D Parkour).
  13. Added 3D Parkour 2 Alpha as a demo.
  14. Instead of typing GCLS:BUFFER:RENDER you now just type RENDER to do everything.
  15. GETRAY2D now only takes in X,Z as opposed to X,Y,Z.
  16. Added variables to keep track of an object's scale.
  17. Added OBJSTR$ variables, which work the same as the OBJTAG$ variables.
  18. Added SETSTATICOBJ function to set if an object is affected by physics or not.
  19. Added variables to define the velocity for each object.

Version 1.4

  1. Added TEXT as a new object type! Check the documentation for more details! Game worlds can easily display messages as 3D objects.
  2. CHESS.3D has been worked on, the AI is more intelligent and uses alpha-beta pruning to simulate ahead in the future to find how to maximize the minimum score. In the first few lines you can set the AI_VS_AI to watch it play against itself.
  3. Every demo has been updated to make use of the new features.
  4. Fixed the randomly-appearing-flickering-lines-bug for DLC users.
  5. Fixed triangles-sometimes-not-rendering-glitch for non-DLC users.
  6. Also non-DLC users run at a fairly higher framerate due to less function calls.
  7. Perspective calculations and rendering have been worked on a lot, graphics are much smoother.
  8. Added a new demo to showcase 3D randomized fractal tree generation.
  9. Spheres now render without borders to improve the look of scenes.
  10. Changed the way object tags work, instead of saving TAG$ to every triangle it saves it in the objects themselves. Also triangles no longer carry a second color (the sphere border color). Triangles only carry the most necessary data now.
  11. FPS is more smooth/stabilized.
  12. Added the ability to change the view distance to make programs run faster for o3DS users.
  13. Added function APPLYSURFACEEQUATION to automatically set a SURFACE object to mimic a mathematical equation. This makes the code for the GRAPH_3D demo much simpler and gives users much more power to simulate terrain.
  14. Added lots of new functions!

Version 1.3

  1. Added a fully functional 3D chess game against a real AI that looks a few moves ahead to determine the best way to move.
  2. Added an first person shooter game demo.
  3. Added support for 3D lines using ADDLINE(X1,Y1,Z1,X2,Y2,Z2,COLOR).
  4. Added a surface object, which is a grid plane with multiple sections (used in the 3D grapher).
  5. Fixed a few bugs when deleting an object.
  6. Added some new functions.
  7. BUFFERing only buffers the top screen, use BUFFERBOTTOM to buffer the lower screen.
  8. Other small tweaks and optimizations.

Version 1.2

  1. Framerate has been doubled and possibly tripled, especially for DLC users. The engine runs incredibly fast for users that have purchased the SmileBASIC DLC!
  2. SIM.3D no longer needs any other program slots other than 3. So this update makes it a lot more compact and simple.
  3. Hue, saturation, and value are now optional by using HSV(H,S,V) just like RGB(R,G,B). Objects only need a single color value to be initialized. So #RED, #GREEN, #BLUE, etc... can work too.
  4. Field of view (FOV), world scale constant (WSC), and the cutoff ratio (CUTOFF_RATIO) are modifiable. Cutoff ratio is the ratio between the camera and the object of focus in which polygons will no longer be drawn. Default is 0.5.
  5. Lots of new functions that give more power to the user, such as finding the closest/furthest objects to a point, and making an object rotate to face a given point in the world.
  6. Behind the scenes optimizations for maximum performance.

Version 1.1

  1. DLC is fully implemented! The engine runs much smoother when the Advanced Sound DLC is purchased, the application now only needs to run a few ARYOP operations each frame.
  2. Performance without DLC has also been improved, but DLC gives much higher performance.
  3. Circles have been removed, and re-implemented as triangle objects. Now that there is complete consistency with objects, huge performance advancements have been made.
  4. The flickering graphics bug has been targeted and removed. Graphics feel cleaner with modified algorithms.
  5. Example programs have been modified a little bit. Please feel free to view the code for those, and use them to implement your own games. I do not require any credit. Everything is free for everybody.
  6. Triangles are now sorted by the furthest away Z point.
  7. CIRCLE functions are now called SPHERE functions.
  8. All future updates from this point forward will minimize the modifications required for a game to run on the updated engine. Any modifications required will be listed down here for you.

Version 1.0

  1. Application is stable.
Notes This application was designed specifically to teach the idea of 3D game design. While this engine was built with simplicity in mind, it was also built to maximize efficiency and minimize the computation required to display good looking graphics. With that said this is an excellent engine to make 3D games, I don't ask for any credit, and anyone can use this program for their own purposes. Use the comment section below for help, or if you have any questions, I'll be glad to help! To see the power of SIM.3D, I added some regular demos that will give a better idea on how to use SIM.3D. The files include:
  1. 3D.ENGINE - The engine in all it's glory.
  2. BOX_O_GEMS - A demo to show all the different kinds of objects, and how fast they render.
  3. CHESS.3D - A rather complex program to show what can be made with SIM.3D.
  4. FPS_DEMO - A first-person-shooter-styled simulation, on a Perlin-noise-generated map.
  5. GRAPH_3D - A powerful yet simple 3D equation grapher.
  6. PARKOUR2_ALPHA - The new development of 3D Parkour 2, in alpha state.
  7. SIERPINSKI - Using simple code to generate a Sierpinski pyramid.
  8. SIMPLE_CUBES - A short code demo to show how SIM.3D is used.
  9. SPIRAL_SPHERE - Generate colorful sphere-spirals of spheres.
  10. SPLIT_SCREEN - Example of using splitscreen (with 3D Parkour 2 Alpha)
  11. TREE_OF_WISDOM - Showcasing three dimensional fractal tree generation using simple recursion.
To use this engine, simply add this to the first line of your code PRGEDIT 3 EXEC "PRG3:3D.ENGINE" ENDDoing so will load the 3D engine into program slot 3, then insert the code from program slot 0 into program slot 3, then execute itself. The most basic application to rotate a cube in the center of the screen is as follows: PRGEDIT 3 EXEC "PRG3:3D.ENGINE" END 'S1M.3D VAR C=ADDCUBE(0,0,0,1,1,1,#GRAY) 'C CONTAINS A REFERENCE TO THE CUBE @LOOP VSYNC 'STABALIZE THE FRAMERATE ROTOBJ C,0,1,0 'ROTATE THE CUBE AROUND THE Y AXIS RENDER 'RENDER THE WORLD GOTO @LOOP 'REPEAT There are a few things to be aware of before diving into the 3D engine
  1. One in-world unit is the equivalent of 50 pixels. Adding a scale definition like this makes the game feel more realistic. This can be customized by changing the WSC (world scaling contant) variable.
  2. When working with SIM.3D, you must work in the default program slot 0, you will need to save every time you run the code. Any errors can be traced to your code in program slot 3 where the actual engine is.
  3. Or you could work directly in the 3D engine and avoid the use of the loader. There's a spot in the beginning of the code dedicated for user programs to go.
  4. Every object is composed of triangles. If a triangle is defined clockwise then it will be visible from the outside of the object. There are preset objects to make this easier to work with.
  5. So triangles can only be seen from one side (for higher performance), using STRETCHOBJ with negative values to stretch an object inside-out will let you see the object's back faces instead of front
  6. Every object is given an index. This index will never change until the object is deleted, in which case the ID will be given to the next future object to be defined.
Engine variables:VAR CAMX,CAMY,CAMZ 'THE FOCUS POSITION OF THE CAMERA (DEFAULT: 0,0,0) VAR CAMRX,CAMRY,CAMRZ 'ROTATION OF THE CAMERA (IN DEGREES) AROUND THE CAMERA FOCUS (DEFAULT: 0,20,0) VAR CAMDIST 'DISTANCE AWAY FROM CAMERA'S FOCUS POINT (DEFAULT: 10) VAR FOV 'FIELD OF VIEW (DEFAULT: 5) VAR WSC 'WORLD SCALING CONSTANT IN PIXELS (DEFAULT: 50) VAR CUTOFF_RATIO 'THE RATIO BETWEEN CAMERA AND FOCUS IN WHICH THINGS STOP RENDERING (DEFAULT: 0.7) VAR BOUNDCAMANGLES 'TRUE/FALSE, TELL IF THE CAMERA SHOULD BE BOUNDED BETWEEN -180 AND 180 (DEFAULT: 1) VAR RENDERDIST 'HOW FAR THE PLACER CAN SEE, 0=INFINITE (DEFAULT: 0) VAR ACCELERATED_RENDERING 'TRUE/FALSE TO USE ADVANCED SOUND DLC (DEFAULT: 1 IF POSSIBLE) VAR FPS 'FRAMES PER SECOND VAR GMW0,GMH0 'Where the screen starts (default: 0,0) VAR GMW1,GMH1 'Where the screen ends (default: 400,240) VAR GMW05,GMH05 'Defines the center of the screen to save computational resources Here are the preset object definitions:ADDCUBE(X,Y,Z,LENGTH,WIDTH,HEIGHT,COLOR) 'CREATES A RECTANGULAR PRISM, RETURNS ITS INDEX ADDWCUBE(X,Y,Z,LENGTH,WIDTH,HEIGHT,COLOR) 'CREATES A WIREFRAME RECTANGULAR PRISM, RETURNS ITS INDEX ADDSPHERE(X,Y,Z,RADIUS,COLOR) 'CREATES A SPHERE, RETURNS ITS INDEX IN THE WORLD ADDLINE(X1,Y1,Z1,X2,Y2,Z2,COLOR) 'CREATES A LINE, RETURNS ITS INDEX ADDPYRAMID(X,Y,Z,WIDTH,HEIGHT,COLOR) 'CREATES A PYRAMID, WHERE THE BASE OF THE BOTTOM IS X,Y,Z 'RETURNS THE OBJECT'S INDEX ADDDIAMOND(X,Y,Z,WIDTH,HEIGHT,COLOR) 'RETURNS THE OBJECT'S INDEX ADDCRYSTAL(X,Y,Z,WIDTH,HEIGHT,COLOR) 'RETURNS THE OBJECT'S INDEX ADDSKYBOX(X,Y,Z,LENGTH,WIDTH,HEIGHT,COLOR) '(AN INSIDE-OUT CUBE) 'RETURNS THE OBJECT'S INDEX ADDSURFACE(X,Y,Z,GRIDX,GRIDY,LENGTH,WIDTH,COLOR) 'CREATE A FLAT GRID PLANE, RETURNS ITS INDEX ADDFLAG(X,Y,Z,COLOR) 'CREATE A FLAG CHARACTER OBJECT, RETURNS ITS INDEX ADDTEXT X,Y,Z,TEXT$,COLOR 'MAKE A TEXT OBJECT IN THE WORLD 'RETURNS THE OBJECT'S INDEX You may also consider defining your own objectADDOBJ(TYPE$,X[],Y[],Z[],COLOR) 'X[],Y[],Z[] DEFINE EACH TRIANGLE. THESE ARRAYS MUST BE IN SETS OF 3, SO LENGTH=3,6,9,12,15,18,... Every object contains these variables:OBJX 'CENTER OF MASS X POSITION OBJY 'CENTER OF MASS Y POSITION OBJZ 'CENTER OF MASS Z POSITION OBJTEXT$ 'A STRING (USED IN TEXT OBJECTS) OBJTAG$ 'A STRING ONJTYPE$ 'A STRING TELLING WHAT TYPE OF OBJECT IT IS OBJINDEX 'THE INDEX POINTING TO WHICH TRIANGLES BELONG TO THIS OBJECT OBJLENGTH 'THE LENGTH OF HOW MANY TRIANGLES BELONG TO THIS OBJECT OBJRX 'GET (NO SET) THE OBJECT'S X ROTATION OBJRY 'GET (NO SET) THE OBJECT'S Y ROTATION OBJRZ 'GET (NO SET) THE OBJECT'S Z ROTATION OBJSX 'GET (NO SET) THE OBJECT'S X SCALE (WIDTH) OBJSY 'GET (NO SET) THE OBJECT'S Y SCALE (HEIGHT) OBJRZ 'GET (NO SET) THE OBJECT'S Z SCALE (LENGTH) OBJMINX 'GET (NO SET) THE OBJECT'S MINIMUM X VALUE OBJMINY 'GET (NO SET) THE OBJECT'S MINIMUM Y VALUE OBJMINZ 'GET (NO SET) THE OBJECT'S MINIMUM Z VALUE OBJMAXX 'GET (NO SET) THE OBJECT'S MAXIMUM X VALUE OBJMAXY 'GET (NO SET) THE OBJECT'S MAXIMUM Y VALUE OBJMAXZ 'GET (NO SET) THE OBJECT'S MAXIMUM Z VALUE OBJVX 'THE OBJECT'S X VELOSITY OBJVY 'THE OBJECT'S Y VELOSITY OBJVZ 'THE OBJECT'S Z VELOSITY OBJVISSTATIC 'TRUE/FALSE, IF THE OBJECT IS AFFECTED BY PHYSICS OBJMASK 'WHEN YOU DEFINE AN OBJECT YOU ARE GIVEN A MASK INDEX WHICH WILL NEVER 'CHANGE, SO YOU CAN ONLY ACCESS THE VARIABLES ABOVE BY GOING THROUGH THE OBJECT MASK 'FIRST: OBX[OBJMASK[MY_OBJECT_INDEX]]=FOO 'BY USING THIS MASK, WE CAN GUARANTEE THAT AN OBJECT INDEX WILL NEVER CHANGE 'EVEN IF OBJECTS BEFORE IT ARE DELETED. Here is a list of object functionsSTRETCHOBJ INDEX,SCALEX,SCALEY,SCALEZ 'SQUISHES OR STRETCHES AN OBJECT'S POINTS BY A GIVEN SCALE MOVEOBJ INDEX,DX,DY,DZ 'INCREMENT AN OBJECT'S POSITION MOVEOBJTO INDEX,X,Y,Z 'TELEPORT AN OBJECT SOMEWHERE ROTOBJ INDEX,AX,AY,AZ 'INCREMENT THE ROTATION OF AN OBJECT AROUND ITS CENTER OF MASS ROTOBJTO INDEX,AX,AY,AZ 'SET THE ROTATION OF AN OBJECT AROUND ITS CENTER OF MASS 'THIS WILL RESET THE OBJECT'S ROTATION TO ITS DEFAULT, THEN ROTATE IT AX,AY,AZ ROTOBJAROUND INDEX,X,Y,Z,AX,AY,AZ 'ROTATE AN OBJECT AROUND (X,Y,Z) ROTOBJAROUNDOBJ INDEX,INDEX2,AX,AY,AZ 'ROTATE AN OBJECT AROUND ANOTHER OBJECT ROTOBJTOPOINT INDEX,X,Y,Z 'ROTATE AN OBJECT SO THAT IT FACES THE POINT X,Y,Z MERGEOBJS(INDEX1,INDEX2) 'MERGE TWO OBJECTS, RETURNS THE NEW INDEX SPLITOBJ INDEX,TRIANGLES OUT INDEX1,INDEX2 'SPLIT AN OBJECT, DEFINING THE AMOUNT OF TRIANGLES FOR THE FIRST OBJECT DELOBJ INDEX : INDEX=-1 'DELETE AN OBJECT FROM THE WORLD CHANGEOBJCOLOR INDEX,COLOR 'SET AN OBJECT'S COLOR CHANGEOBJFACECOLOR INDEX,FACE,COLOR 'SET THE COLOR OF A SINGLE TRIANGLE ON AN OBJECT CHANGEOBJCOLORAB OBJECT,INDEX1,INDEX2,COLOR 'SET AN OBJECT'S COLOR FROM INDEX1 TO INDEX2 INSIDE THE OBJECT 'OBJECT TRIANGLE INDEXES START AT 0 FOR EACH OBJECT SETTAG INDEX,TAG$ 'GIVE AN OBJECT A STRING, DEFAULT="" 'THIS CAN BE ANYTHING, IT DOESN'T AFFECT THE 3D ENGINE GETTAG$(INDEX) 'GET THE TAG$ VALUE OF AN OBJECT FINDIBJBYTAG(TAG$) 'QUICKLY FIND AN OBJECT WITH A SPECIFIC TAG$ VALUE 'RETURNS -1 IF NO OBJECT EXISTS WITH THIS TAG SETSTR INDEX,S$ 'GIVE AN OBJECT A STRING, DEFAULT="" 'THIS IS USED TO STORE THE VALUE IN TEXT OBJECTS GETSTR$(INDEX) 'GET THE STRING VALUE OF AN OBJECT FINDIBJBYSTR(S$) 'QUICKLY FIND AN OBJECT WITH A SPECIFIC STRING$ VALUE 'RETURNS -1 IF NO OBJECT EXISTS WITH THIS STRING GETOBJTYPE$(INDEX) 'RETURNS THE STRING DEFINING WHAT TYPE OF OBJECT IT IS 'POSSIBLE RESULTS ARE: "CUBE","SPHERE","DIAMOND","CRYSTAL","PYRAMID","SKYBOX","LINE","SURFACE","TEXT" GETOBJSBYDIST(X,Y,Z) 'RETURNS A SORTED ARRAY OF OBJECT INDEXES SUCH THAT THE FIRST ITEM IS CLOSEST 'TO (X,Y,Z) AND THE LAST ITEM IS FURTHEST AWAY FROM (X,Y,Z) 'AND THE LAST ITEM IS FURTHEST AWAY FROM (X,Y,Z) UPDATEWCUBEAROUNDOBJ INDEX1,INDEX2 'CHANGE THE WIREFRAME CUBE OBJECT INSIDE INDEX1 TO THE SAME SHAPE AND 'SIZE OF THE OBJECT INSIDE INDEX2 (INDEX1 MUST BE A WCUBE OBJECT) APPLYSURFACEEQUATION INDEX,EQU$,MINY,MAXY,SCX,SCY,SCZ 'APPLY A MATH EXPRESSION TO A SURFACE OBJECT 'EQU$ IS AN EQUATION WITH X,Y, AND Z IN IT 'EQU$="SIN(X)+COS(Z)" MAKES A WAVY SURFACE 'MINY AND MAXY DEFINE THE OBJECT'S Y BOUNDS 'SCX,SCY,SCZ ARE THE ZOOM FACTORS, 0.1=>10X ZOOM GETUNMASKEDINDEX(MASKEDINDEX) 'SAME AS SAYING OBJMASK[MASKEDINDEX] UPDATEOBJCENTER INDEX 'UPDATES THE CENTER OF MASS OF AN OBJECT (DONE AUTOMATICALLY) SETSTATICOBJ INDEX,STATE 'SET IF AN OBJECT IS AFFECTED BY GRAVITY AND COLLISIONS 'STATE IS EITHER 1 OR 0 (0=nOT STATIC (PHYSICS)) ADDVEL INDEX,VX,VY,VZ 'ADD VELOCITY TO AN OBJECT 'YOU COULD ALSO JUST DO: 'OBJVX[OBJMASK[INDEX]]=X 'OBJVY[OBJMASK[INDEX]]=Y 'OBJVZ[OBJMASK[INDEX]]=Z And a few other functions, slightly unrelated, but implemented nonetheless:RENDER 'DRAWS THE CURRENT WORLD STATE, REQUIRED TO RUN ONCE EVERY FRAME BUFFER 'PREVENTS FLICKERING BY SWAPPING GPAGES EACH FRAME, DRAWING TO THE ONE NOT 'BEING SHOWN. THIS SHOULD BE RAN ONCE EVERY FRAME, WITH A GCLS DIRECTLY AFTER IT 'THIS ONLY AFFECTS THE TOP SCREEN 'THIS IS AUTOMATICALLY CALLED INSIDE RENDER _RENDER 'RENDERS THE SCENE WITHOUT CALLING BUFFER AND CLEARING THE SCREEN BUFFERBOTTOM 'PREVENT FLICKERING ON THE LOWER SCREEN, PUT GCLS DIRECTLY AFTER IT SPLITSCREENDRAW X1,Y1,Z1,RX1,RY1,RZ1,X2,Y2,Z2,RX2,RY2,RZ2 'REPLACES THE RENDER FUNCTION 'DRAWS TWO PERSPECTIVES FROM TWO CAMERA POSITIONS AND ANGLES QUADRUPLEDRAW X1,Y1,Z1,RX1,RY1,RZ1,X2,Y2,Z2,RX2,RY2,RZ2,X3,Y3,Z3,RX3,RY3,RZ3,X4,Y4,Z4,RX4,RY4,RZ4 'REPLACES THE RENDER FUNCTION 'DRAWS FOUR PERSPECTIVES FROM FOUR CAMERA POSITIONS AND ANGLES GETCAMRAY OUT X,Y,Z 'RETURNS THE NORMALIZED DIRECTION THE CAMERA IS FACING GETCAMRAY2D OUT X,Z 'RETURNS THE NORMALIZED DIRECTION THE CAMERA IS FACING EXCLUDING Y RAYTHROUGHOBJ(X,Y,Z,RX,RY,RZ,INDEX) 'CHECK IF THE RAY STARTING AT X,Y,Z AT THE ANGLE RX,RY,RZ 'IS COLLIDING WITH THE OBJECT INSIDE INDEX NORMALIZE X,Y,Z OUT X,Y,Z 'SET THE DISTANCE OF AN X,Y,Z DISPLACEMENT EQUAL TO 1 'WHILE MAINTAINING THE ANGLE CLEARWORLD 'DELETES EVERYTHING IN THE WORLD 'TRIANGLE OPERATION FUNCTIONS ADDTRI INDEX,TAG$,X1,Y1,Z1,X2,Y2,Z2,X3,Y3,Z3,COLOR SETTRI INDEX,X1,Y1,Z1,X2,Y2,Z2,X3,Y3,Z3 'SET A TRIANGLES POSITION DELTRI TRIANGLEINDEX 'DELETE A TRIANGLE '3D POINT ROTATION FUNCTIONS ROT X,Y,Z,ORIGINX,ORIGINY,ORIGINZ,ANGLEX,ANGLEY,ANGLEZ OUT X,Y,Z ROTX X,Y,Z,ANGLE OUT X,Y,Z 'ROTATE A POINT JUST AROUND X AXIS ROTY X,Y,Z,ANGLE OUT X,Y,Z 'ROTATE A POINT JUST AROUND Y AXIS ROTZ X,Y,Z,ANGLE OUT X,Y,Z 'ROTATE A POINT JUST AROUND Z AXIS INSERT ARRAY[],INDEX,VALUE 'QUICKLY INSERT AN ELEMENT INTO AN ARRAY REMOVE ARRAY[],INDEX 'QUICKLY REMOVE AN ELEMENT FROM AN ARRAY TRIM$(S$) 'REMOVE SPACES AND NEW LINES FROM THE FRONT AND END OF A STRING 'HSV OPERATIONS HSV2RGB HUE,SATURATION,VALUE OUT RED,GREEN,BLUE RGB2HSV RED,GREEN,BLUE OUT HUE,SATURATION,VALUE HSV(HUE,SATURATION,VALUE) 'RETURNS THE COLOR AS A SINGLE NUMBER, JUST LIKE RGB(R,G,B) DOES FCIRCLE X,Y,RADIUS,FILLCOLOR,BORDERCOLOR 'DRAW A FILLED CIRCLE TEXT X,Y,TEXT$,COLOR 'DRAW CENTERED TEXT ON THE SCREEN PERSPECTIVE X,Y,Z OUT X,Y,Z 'CONVERT IN-WORLD COORDINATES TO SCREEN COORDINATES PERSPECTIVEZ(X,Y,Z) 'QUICKLY JUST CALCULATE THE Z VALUE AFTER PERSPECTIVE ARYOP_PERSPECTIVE X[],Y[],Z[] OUT X[],Y[],Z[] 'CALCULATE FASTER PERSPECTIVE
Categories
Keywords
  • 3D
  • game
  • engine
225 Comment(s) kevinfoley kevinfoley To settle this madness, I have uploaded a project which recreates the general conditions of defrost2's benchmark. Download key is TRDVF3Z4 As I expected, there's a margin of error. Some times ints finish slightly faster, and sometimes floats do. Overall I would say the differences are statistically insignificant. There are two files. GTRITEST draws a triangle over half the screen as dfrost2 described. This bottlenecks on fill rate, so I created another version GTRITEST2 which draws much smaller triangles, and thus can draw a lot more of them. In the latter test, it takes about 1 second to draw 50000 triangles, which is impressive. Sometimes floats finish a few ms faster, sometimes ints do, sometimes they tie. dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Just figured out an optimization you can make, Simeon. On PERSPECTIVE, you should change X2, Y2, and Z2 to X2%, Y2%, and Z2%. This is because you can't draw a point at (0,20.5) and so it has to convert it to an int. Since X2,Y2, and Z2 are screen coords, why would they be floating point numbers? dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength hell, if WSC = 1, you could make X,Y,Z to X%,Y%,Z% These is just theories, but they should help EDIT: just tested it. I was right: (units: pixels/ second) reals: 76080000 ints: 76128000 Additional information: both draw GTRI 0,0,400,0,400,240 Counted the amount of calls/second and multiplied it by (400x240)/2 This really just proves that graphics have to convert reals to ints and ints are faster for drawing kevinfoley kevinfoley 76080000 / 76128000 = 0.9994. That's a 0.06% increase in performance. Even if it's reproducible, it's not worth changing code over. Shelly Shelly That makes no sense. If he showed you exactly what you need to change, it would take ZERO effort to change. So, how is it not worth changing? 12Me21 12Me21 Head Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website Because it's not zero effort. And there's no reason to get rid of such a nice key just for a 0.06% speed increase which might not even be real. kevinfoley kevinfoley @Shelly Do you realize how small 0.06% is? That's six hundredths of one percent. That means, for example, if you were rendering ten thousand triangles each frame you could fit in an extra 6. And that's if the 0.06% difference was even consistent; it's more likely within the error margin of random fluctuations in CPU speed. Shelly Shelly Yes, I do realize how small that amount is. However, as SmileBASIC gets ported to new platforms the .06% will become more noticeable. The Raspberry Pi version of SmileBASIC performs over 9 times better than the old 3DS in some tasks, and the Switch will most likely perform over 50 times better when doing highly-parallel tasks, such as vector processing with ARYOP. Suddenly, the small difference looks a lot bigger, doesn't it? Also, are we really not going to update a program just because we like the key? That's the funniest thing I've heard all day. kevinfoley kevinfoley "and the Switch will most likely perform over 50 times better when doing highly-parallel tasks, such as vector processing with ARYOP. Suddenly, the small difference looks a lot bigger, doesn't it?" No, that doesn't make any sense. If performance is 5000% faster on the Switch, how does that make 0.06% more important? Let's say you have an operation that takes 50 seconds on the 3DS. A 0.06% performance increase means your operation takes 49,970 milliseconds instead of 50,000 ms. That's 30ms (.03 seconds), or about two frames, faster on the 3DS. Far too little difference to even notice. Now on the Switch, which we're calling 50x faster, the operation would take 1 second, or 1000ms. A .06% increase would shave off 0.6 milliseconds. Again, assuming that you could draw 10,000 triangles in one frame, a 0.06% boost would let you draw an extra 6 triangles. That's not even worth mentioning, much less taking the time to edit the code and upload a new release. And this is all pretending a .06% increase in certain numerical operations would increase total performance by .06% in SIM.3D. It would actually make far less difference since there are many other things going on. Also, again, 0.06% difference in performance is so tiny that it is probably due to minor fluctuations in CPU speed and not an actual performance boost. He'd have to run the test many times to establish a margin of error before saying it's a consistent boost Shelly Shelly Your argument is hilarious. My guess was actually low. The Switch's GPU alone can do over 1 TFLOPS, while the WHOLE 3DS can only do 4.8 GFLOPS. That means the Switch is at least 208 times faster. So, I'm guessing we'll be able to get over 200 times faster ARYOP, maybe more. ARYOP almost certainly uses the GPU's vector cores, which is why I'm guessing so high. Now, back to the .06% increase. Let's assume the New 3DS can do 10000 triangles per frame. That would mean the Switch could do 2,000,000 triangles per second, assuming my estimate was correct. .06% of 200,000 is 1200, which is actually a lot. That's enough for a fairly detailed character. kevinfoley kevinfoley Don't be ridiculous. SB on the 3DS can render a few hundred tris per frame at 60fps. 10,000 triangles is a conservative estimate of what might be possible if the Switch is really much faster. And the GPU performance isn't relevant when we're discussing performance increase from changing the numeric type of a variable. That's handled by the CPU. Again, 0.06% is meaningless. What margin of error is that in? .06% is meaningless if there's a 1% margin of error. Let's see the test run a few dozen times before taking the results seriously. Also, a .06% increase for certain operations does not make the entire program .06% faster. I've explained this enough. Shelly Shelly lmao. Your math makes no sense. If a 3d engine in SmileBASIC can do 200 (lowest possible value for "a few hundred"), and the Switch can do over 200 times what the 3DS can do (based on my math), that would mean the Switch would be able to do 40,000 per frame. You said 10,000, which makes no sense. Y_ack Y_ack commenting on someone's math while disregarding a basic point about statistical significance is interesting. That said, using integers where possible really does have known improvements on performance. Like kevinfoley says though, that only applies to the sections that are dealing with the coordinates mentioned in OP, not necessarily the rest of the 3D math. There's nothing left to discuss unless either Simeon decides to make a modification or someone produces real evidence, so... you don't have to act so awful. kevinfoley kevinfoley "You said 10,000, which makes no sense." We're speculating and throwing out random guesses for how many triangles it can render. It doesn't matter how many TFLOPS the GPU is, the code we are discussing runs on the CPU. Shelly Shelly I'm about to fucking die laughing. You said it yourself that it has been proven that integers speed up math, but you saying that I'm disregarding a "basic point about statistical significance" would mean that my hypothesis was unlikely to be true. You just contradicted yourself. Shelly Shelly Replying to kevin: As I previously explained, it is almost certain that SB uses the GPU for ARYOP, which is what 3D engines in SB use for their math (or good ones, at least). It would be idiotic of them to not use the GPU, since the GPU uses vector cores that are perfect for ARYOP. kevinfoley kevinfoley The basic point about statistical significance is that 0.06% is not statistically significant. The margin of error is probably much higher than that. I've seen a 2% margin of error on some tests I've done in SB, though I've never tested ints vs floats. I don't have my 3DS with me to test this at the moment. kevinfoley kevinfoley "it is almost certain that SB uses the GPU for ARYOP" Does the PICA200 even support GPU-compute? Y_ack Y_ack https://www.3dbrew.org/wiki/GPU/Shader_Instruction_Set 12Me21 has mentioned that the ARYOP operations match up with the operations supported by "some hardware thing" I don't know anything about GPUs but this is likely the case if only because it requires far less effort on SmileBoom's part to implement. kevinfoley kevinfoley Shader programming is used to code shaders that affect how an image is rendered onscreen. I am not an expert in general purpose GPU compute but I'd be surprised if it was easy to use shader language for running general-purpose mathematical operations that get sent back to the CPU. NVidia had to create CUDA to make GPUs easier to work with for non-graphical calculations and the PICA200 almost certainly doesn't support anything like CUDA. The ARM11 supports SIMD (parallel vector operations), so it seems more likely this would have been handled by the CPU. https://en.m.wikipedia.org/wiki/SIMD I know nothing at all about DSPs, but since this is a Sound DLC, I wonder if the DSP can do array operations... Y_ack Y_ack I just remembered something important
12Me21[18:35]g: ARYOP is about 3x slower on integer arrays compared to float arrays
ARYOP takes float data and has to convert integer input in order to use it either what dfrost is suggesting is a bad idea in context because it will need to be real-type for ARYOP anyway, or the integer thing might apply, but this routine doesn't even use ARYOP, and what Shelly said is irrelevant.
Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Oh
dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength You could make it draw triangular - shaped sprites which are rendered twice as fast and this also brings in textures into the mix. kevinfoley kevinfoley Using triangle sprites would require being able to apply arbitrary transformations (or at least 3D rotation) to the sprites. I don't believe that's possible in SmileBASIC. dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength not necessarily: check up on P3D. It uses sprites to render. Also don't forget that POLY3D is doing the same thing, but with graphics. Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Yes, but it does that through the chopping up of a single sprite and displaying each slice at a different orientation to achieve the skew transformation. It brings a trade-off between performance and graphical artifacts. I suppose it would be possible to only have sprites for the closest ~2 faces, but that would ruin the polygon-feel and have a large computational overhead. In the next version I will add sprite objects, which will be 2D sprites in the 3D world and behave the same as spheres, but I think this is the closest I will get to sprites. I'd like to study the P3D code a bit more first. dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength If you don't feel like it, I could make the GODLY engine. What does ARYOP even do though? Shelly Shelly It allows for vector processing, which is basically operating on large groups of data rather than just one piece of data. I'm assuming it uses the vector cores in the GPU, or SIMD instructions that the CPU has (?). kevinfoley kevinfoley I've been working on Poly3D again, and have spent the last few weeks developing a 3D model editor that runs in SmileBASIC. I haven't had a chance to test or look through the code for Sim.3D yet, but I imagine that my model editor could be adapted for use with Sim.3D without too much trouble. I was planning on creating some additional sample projects before uploading the next version of Poly3D, but maybe I'll release early so that the model editor can be adapted to Sim.3D. Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies That sounds really cool! I'd be happy to work with you on that. I'll look through the Poly3D code. kevinfoley kevinfoley Thanks! I wouldn't bother looking through the current code; the new code should be up in a few days and is much cleaner. I've looked through your Sim.3D examples now and your feature set is impressive. Very cool stuff! I was surprised to read that the Advanced Sound DLC (which I haven't purchased yet) can be used to speed up your rendering process. What functions does the DLC offer that you were able to work into rendering? kevinfoley kevinfoley I've uploaded the new version with model editor! Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Yeah, so the DLC provides the ARYOP instruction, which does simple instructions on large arrays at 10 to 100 times faster than a FOR loop could do. It's highly recommended to have especially for 3D engines. I was able to pull all the 3D computations out of the main for loop, so that the only real overhead is the drawing of graphics. kevinfoley kevinfoley Oh, very cool! Thanks! spaceturtles spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength HEAEP3 - heap 3 RGamesOffical RGamesOffical Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Minecraft Is Awesome! I love Minecraft! Express Yourself Video Games I like to play video games! Hobbies Can the next update be focused on Speed Improvements? My game needs a lot of blocks to be rendered at one time. IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength It’s already fast as sonic the hedgehog lol RGamesOffical RGamesOffical Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Minecraft Is Awesome! I love Minecraft! Express Yourself Video Games I like to play video games! Hobbies (Worlds will be 16x16 chunks, Chunks are 8x8x128, Render distance: 2 chunks at a time) IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength As in sim.3d Shelly Shelly I think that the next update should include a built-in modeler, since this engine seems very powerful, but is kind of a pain to use. IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Yeah, modeling is difficult. I don’t want to spend 3 years modeling a single model and 30 years animating it. That’s the whole reason a 3D platformer I’m making is styled like an N64 game. dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Try P3D. It's awesomely fast and can render textured objects just as fast Here are the cons: pros Pros: very fast(at least for sb) textured easy to model objects cons: hard to understand a lot of WTF's will come to mind Shelly Shelly I was thinking about doing that, but I prefer SIM.3D since it is actively being developed, which isn't as true for P3D. Shelly Shelly What is the maximum number of polygons it can render per frame without having to use multiple frames? MochaProbably MochaProbably 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 Drawing I like to draw! Hobbies Probably depends on what the polygons are doing. IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength It also depends on whether you are on o3DS n3DS or Wii U and if you have the DLC or not. Shelly Shelly Tris on old 3ds, with dlc Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Once 3D Parkour 2 gets developed more, I will give it it's own submission key. I'm taking any feedback, so if you have any cool ideas for it let me know! I'm thinking to make the game about orbiting around objects instead of linear gravity spaceturtles spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Buttons, switches, and moving booby traps would bring it more life. 12Me21 12Me21 Head Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website enter it in the OSP contest lol MZ952 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies Interactive objects would be kinda cool, like spaceturtles suggested. Shelly Shelly Is the whole guide thing dead? Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies If you mean the SIM.3D documentation, no. Everything is still being developed. If you mean the tutorial on building a new 3D engine, yeah, sorry. It's a lot of work and I don't think it would turn out very good regardless. IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength How to outsmart the chess AI (as of 1.4) in 5 easy steps! IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Bug:if you move a sprite, the geometry disappears. I found this because I wanted to make a game with 3D geometry, but 2D characters and stuff JUST BECAUSE I WANT 3D GEOMETRY IN A GAME DOESN'T MEAN I WANT 3D CHARACTERS IN SAID GAME Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies That'd be a cool feature to add, ill look into it thanks Late response, my bad IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength It’s okay. MochaProbably MochaProbably 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 Drawing I like to draw! Hobbies Im not sure if this has to came to anybody's attention but, do notice how Spooky Maze uses Textures on its walls. It uses raycasting to get a slice of a sprite and draws it onto the screen. Its very efficient and could be be used in a situation like a 3D engine. you would need many more rays, but if you were to lower the resolution to half for New3DS's and a quarter for Old3DS's, the performance should be usable, and allow for images to be pasted onto 3D geometry. Locking the FPS to 45 or 30 using this method would yield good results as well. Its all a theory though, but ill attempt a test of this idea later, probably nearing the end of the month or mid-June. snail_ snail_ Helper Received for being very helpful around SmileBASIC Source Achievements OSP Contest 2 Contest Participant I participated in the second SmileBASIC Source OSP Contest! Night Person I like the quiet night and sleep late. Express Yourself You can only use that type of raycasting on regular grids or scenes where everything is parallel lines, as far as I'm aware. You could try something like the classic DOOM engine, but I think you'll have to do most of it in software and it'll end up too slow. MZ952 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies Well, sprites can be rotated too. Warrior is right I believe. Account for the camera & object rotations, and you should be able to transform the sprite image into the required 3d shape. dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength the VSYNC is slowing it down.(I know it will flicker without it), but how about you use this custom command: DEF WAITTIME A M = MILLISEC WHILE MILLISEC-M>A:WEND END this waits for smaller units of time(which could help with FPS barely) since the refresh rate of almost every modern device is 60FPS, we can assume that VSYNC waits ~16.667 milliseconds(1000/60) As we all know, the human eye(on average)sees at ~24 FPS Using this command, we can make a smaller wait time for refreshing, therefore higher FPS. I would recommend a wait time of...33.33ms. Seems stupid, but that should include rendering AND refresh time. Y_ack Y_ack Did you actually test this before posting? MasterR3C0RD MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself 33.33ms frame time is 30FPS, you know dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength (its a theory) niconii niconii Video Games I like to play video games! Hobbies Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Drawing I like to draw! Hobbies
As we all know, the human eye(on average)sees at ~24 FPS
This is a myth. The truth is more complicated, but the fastest we can perceive motion generally lies somewhere above 60 FPS. Luckily, with SmileBASIC, we don't have to rely on hearsay -- it's easy to test this for ourselves. (Hold R to switch to 60 FPS.) ACLS SPSET 0,2048 SPSCALE 0,2,2 WHILE TRUE T=MAINCNT X=80*SIN(T/8)+200 Y=80*COS(T/8)+136 SPOFS 0,X,Y CLS ?T IF BUTTON() AND #R THEN ?"60 FPS" VSYNC 1 ELSE ?"30 FPS" VSYNC 2 ENDIF WEND
dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength I'm trying to say Simeon needs to use this custom command the for *exact* amount of time to stop flickering at a minimum wait time Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Well, but VSYNC does that And simple is better If there's any flickering then BUFFER isn't working properly dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength OK, I'm just making a fool of myself. Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Nah don't worry about it man, you gave me lots of great suggestions that I'll be working on, I've just been a little bit too busy with school to put more effort into your requests. In most programming languages, simple is not better especially with 3D engine building. When there are strict computing limitations, in my opinion it seems unnecessary to put extra effort into mipmaps and texture mapping. The issue I see with decreased triangle count as objects get far away, is the issue is of actually detecting when they're far away since the slightest additions of computations dramatically change the performance. In SmileBASIC, its a little bit strange because the more code, the slower it gets since there seems to be a small portion of overhead for each line of code. It's hard to detect, but because of this limitation we're forced to use the minimum number of commands. Granted, I'm sure if 12Me21 was to look over SIM.3D, he'd be able to optimize this much more than any of us could. It seems that the biggest optimization to be made is converting floating point variables to integer variables (using %). I'll look more into all of this when I get the time. dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength I'm just saying there might be a refresh rate that will stop flickering and spend less time WAITING. I'm just visualizing frame time in a spectrum like this: ("*" means that framerate will cause a visible flicker) ("0" means that flicker is invisible) *0 I think there might be a *perfect* wait time that will wait for the least amount of time to stop flickering and not be time-consuming. I want a framerate between the "*" and "0" dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength IM BAAAAAACK!
dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength I just played some Fortnite(which uses Unreal Engine 4) and I noticed something: when you are far away from an object, the resolution is really low. Also, the triangle count in an object decreases. Maybe Simeon can (somehow) implement this in SIM.3D... to conserve RAM and increase FPS dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength There should be a way to make a new(object); After an object is defined, you should have the ability to add another of the same object Killias12 Killias12 Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Pokemon Is Awesome! I love Pokemon! Express Yourself Video Games I like to play video games! Hobbies "Also non-DLC users run at a fairly higher framerate due to less function calls." Shouldn't that say DLC users? because I got the DLC and noticed a higher framerate niconii niconii Video Games I like to play video games! Hobbies Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Drawing I like to draw! Hobbies I think they mean higher compared to the previous version, not compared to DLC users. Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Yeah, haha I probably should have worded that better MochaProbably MochaProbably 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 Drawing I like to draw! Hobbies I wonder if you could UV map textures to tris in a performant manner, or at least raytrace an image of a textured object. dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength you could, but it would be VERY slow. I have no clue how, but it is possible. MochaProbably MochaProbably 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 Drawing I like to draw! Hobbies Well right now the closest thing we can get to textures is coloring polygons on a shape, and good luck trying to render anything with any more detail than a pencil. spaceturtles spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Doing that is possible but it would end up being very slow. dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength I am working on it. It will only use 16x16 textures, though. IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Minecraft uses 16x16 textures, too DUN DUN DUNNNNNNNNNNNNNNNNN dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength *realizes P3D exists so no need for wasting my life on making textured quads* IAmRalsei IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Nice necropost, dfrost2 dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength You could make a ToFloat function like this: COMMON DEF ToFloat(X) RETURN X+. END I also just posted a video on YouTube Imasheep Imasheep Minecraft Is Awesome! I love Minecraft! Express Yourself OSP Contest 1 Contest Participant I participated in the first SmileBASIC Source OSP Contest! OSP Contest 2 Contest Participant I participated in the second SmileBASIC Source OSP Contest! what's a pasocom mini? spaceturtles spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength It's basically a Raspberry pi modified to run sb. It's also a little expensive. I can't remember the url to get it though. Imasheep Imasheep Minecraft Is Awesome! I love Minecraft! Express Yourself OSP Contest 1 Contest Participant I participated in the first SmileBASIC Source OSP Contest! OSP Contest 2 Contest Participant I participated in the second SmileBASIC Source OSP Contest! sounds cool! 12Me21 12Me21 Head Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website I thought I should mention this, since it might be useful. ARYOP is a *LOT* slower when working with integer arrays, since it uses a built in feature of the 3DS to perform operations on lists of floating point numbers. So if you give it an integer array, it has to convert it first. (It's still faster than a FOR loop though). Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Hmm I didn't know that Thanks for the advice! I'll look into it 12Me21 12Me21 Head Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website Another interesting ARYOP trick: You can use ARYOP #AOPCLP, OUTPUT, ARRAY1,ARRAY2,ARRAY2 to get the minimum elements. dfrost2 dfrost2 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength how do you know? Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies I used this instead of MIN and MAX, clip a number between A and infinity, then infinity and B to get a number between A and B. 12Me21 12Me21 Head Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website why not just clip between A and B directly? Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Oh, I explained that wrong I meant by clamping A to infinity, then B to infinity, you get MAX(A,B) for every item within A and B, then MIN(A,B) by swapping it. I wonder if it would be possible to make an expression parser/evaluator that converts an equation [of arrays] into a series of ARYOPs. That might actually work
1 2 3