Build 2 Released by Ken Silverman
#121 Posted 11 April 2018 - 09:16 AM
#122 Posted 11 April 2018 - 12:33 PM
Also about move_lights, I've made a simplified version with some comments hopefully it's helpful.
move_lights () { for(i=0;i<maplightn;i++) // sets the loop up to go through all the lights, i will be each individual light processed once per frame { j = maplight[i]; // gets the sprite number of the light mapgetspri(j,MAP_SXYZ,&s,&x,&y,&z); // fetches the &s sector, and xyz co-ordinates of the sprite vx = 0; // sin(tim)*dtim; // vx, vy, vz, are the velocity settings tim is set from the klock vy = sin(tim)*dtim; // dtim is the difference in time between this frame and the last vz = cos(tim)*dtim; // set as is will be a clockwise circle on the y z plane with no x movement // if vz = 0 then it would move in a straight line back and forth on the y axis // if vz were sin() instead of cos() it would move in a diagonal line instead of a circle // if vz were -cos() it would be a counterclockwise circle... // speed is set at sin(tim); sin(tim*2) is twice as fast // radius of circle is set at *dtim; sin(tim)*(dtim/2) is half the radius... ontype = mapcoll(&s,&x,&y,&z,vx,vy,vz,mapgetspri(j,MAP_FAT),1,&onsect, &onind); // give the vectors to the engine to work out collision mapsetspri(j,MAP_SXYZ,s,x,y,z); // now move the sprite } }
Here is a sample that may fit what you asked for, faster lights, smaller movements, otherwise just like move_lights () in maptest.kc
This post has been edited by Drek: 11 April 2018 - 12:40 PM
#123 Posted 12 April 2018 - 05:28 AM
Drek, on 11 April 2018 - 12:33 PM, said:
Not sure how to accomplish this when you can't set manual RGB values. At least, I couldn't find a way and Ken told me he didn't think it was a necessary feature...
Actually what would be really welcome is to make a texture surface a light source instead of just sprites.
Quote
Thank you, that's immensely helpful! I have a novice understanding of programming and I take too many breaks in between experimenting with it to really grasp a hold of many of the concepts, not least of which are vector movement and velocity formulae/algorithms.
This post has been edited by MusicallyInspired: 12 April 2018 - 06:01 AM
#124 Posted 12 April 2018 - 12:19 PM
MusicallyInspired, on 12 April 2018 - 05:28 AM, said:
Setting light colours is all done in code, line 541 of maptest.kc is "Process sprite tags"
At line 545 the variable "tag" is set, after that point you can code light colours based on sprite tag, like so;
if (tag == 200) { // any tag # you want mapsetspri(i,MAP_INVISIBLE,1); // toggle visisbility of sprite 0/1 mapsetspri(i,MAP_RGB,2,0,0); // set colour values here }
MusicallyInspired, on 12 April 2018 - 05:28 AM, said:
You could tag a wall and code it to spawn a light, even a spotlight if you wanted. I doubt you can get the entire wall to become a light...
MusicallyInspired, on 12 April 2018 - 05:28 AM, said:
I'm much in the same boat, but one of my other hobbies is theoretical physics, so vector math has slowly creeped its way into my brain somehow.
This post has been edited by Drek: 12 April 2018 - 01:17 PM
#125 Posted 12 April 2018 - 01:21 PM
I'm a little confused why Ken decided to restrict sectors, walls. ceilings, sprites, etc to only having one tag instead of two (hitag/lotag). Would have been handy for a time like this.
#126 Posted 15 April 2018 - 07:34 AM
MusicallyInspired, on 12 April 2018 - 01:21 PM, said:
Sorry I was wrong about the lights colour being only settable in code. The documentation is sort of lacking, but pressing c on any sprite,wall,sector will bring up a colour cube to set a 32bit colour for the object. That's the proper way to do shading, full RGB control. This setting will act as the light colour for any emitters. Also, for shading only, when the colour selector is up, hold RMB and the mouse movement sets "intensity" (shade) without changing colour. Same as keypad + -.
#128 Posted 15 April 2018 - 12:28 PM
My request list so far;
Quote
/r /g /b with hotkeys ALT+R, ALT+G, ALT+B
brings up current values, like ALT+T does for tag
show current rgb values on top right with other info
#129 Posted 15 April 2018 - 07:02 PM
mrDUKE!zone, on 15 April 2018 - 09:04 AM, said:
Yeah. He won't, though. It's a shame. He treats this as nothing more than a hobby project. People really want to use it, though, but can't because he won't open it up or add the features users want. So it's not really good for anything...and I guess that's why he hasn't released it in 8 years or so whenever he started it.
This post has been edited by MusicallyInspired: 15 April 2018 - 07:06 PM
#130 Posted 15 April 2018 - 07:37 PM
#131 Posted 15 April 2018 - 07:41 PM
#132 Posted 17 April 2018 - 11:37 AM
Here is my tools folder list.
Quote
poly2vox
slab6
strip2voxel3beta.1
vox2png
#133 Posted 17 April 2018 - 12:51 PM
I don't know. I'm new to voxels.
#134 Posted 17 April 2018 - 01:33 PM
Magica Voxel I've heard good things about, and have found it useful a few times, it's a full .vox compatible editor.
#135 Posted 17 April 2018 - 04:03 PM
This post has been edited by Micky C: 17 April 2018 - 04:03 PM
#136 Posted 17 April 2018 - 04:05 PM
http://guillaumecher...ithub.io/goxel/
https://blackflux.com/node/11
#137 Posted 17 April 2018 - 04:34 PM
Tea Monster, on 17 April 2018 - 04:05 PM, said:
http://guillaumecher...ithub.io/goxel/
https://blackflux.com/node/11
Thanks I haven't heard of either of them. I'll look into them both.
Micky C, on 17 April 2018 - 04:03 PM, said:
Yes. With evaldraw I think I can do "soft" animations. That's where an enemy would be made up of multiple voxels, each one controlled by code to move separately to make the animations. An example of this is voxelstein or ace of spades.
#139 Posted 22 April 2018 - 09:39 AM
faceplayer3D(i,ix,iy,iz) { ha = atan2(ipos.y - iy, ipos.x - ix)-1.6; va = (ipos.z - iz)/(sqrt((ipos.x - ix)*(ipos.x - ix) + (ipos.y - iy)*(ipos.y - iy) + (ipos.z - iz)*(ipos.z - iz))); if (va>.99) va=.99; if (va<-.99) va=-.99; va = tan(va); mapsetspri(i,MAP_HVANG,ha,va); }
I've been working on voxel animations, it's a mess right now to say the least, thinking about parent/child relationships and general 3D world orientations that need to carry from a parent to it's animated children. Here is a function I'm working on that I think is working ok, I'm hoping it's useful to someone here and maybe even I could get some constructive criticism because it's a bit outside my comfort zone. This should keep a sprite facing the camera, where the orientation is the same as it would be loaded into slab6.
it may read better like this;
Hangle = atan2(ipos.y - iy, ipos.x - ix)-1.6; XYZdist = (sqrt((ipos.x - ix)*(ipos.x - ix) + (ipos.y - iy)*(ipos.y - iy) + (ipos.z - iz)*(ipos.z - iz))); Zdiff = (ipos.z - iz); va = Zdiff/XYZdist; // tan()=opp/adj if (va>.99) va=.99; if (va<-.99) va=-.99; Vangle = tan(va); mapsetspri(i,MAP_HANG,Hangle); mapsetspri(i,MAP_VANG,Vangle);
This post has been edited by Drek: 22 April 2018 - 09:43 AM
#140 Posted 22 April 2018 - 12:40 PM
faceplayer3D(i,ix,iy,iz) { ha = atan2(ipos.y - iy, ipos.x - ix)+1.572; va = tan(((iz - ipos.z)*.95)/(sqrt((ipos.x - ix)*(ipos.x - ix) + (ipos.y - iy)*(ipos.y - iy) + (ipos.z - iz)*(ipos.z - iz)))); mapsetspri(i,MAP_HVANG,ha,va); }
#141 Posted 26 April 2018 - 07:49 AM
#142 Posted 26 April 2018 - 09:56 AM
This post has been edited by Mark.: 26 April 2018 - 09:57 AM
#143 Posted 26 April 2018 - 10:01 AM
#144 Posted 26 April 2018 - 10:06 AM
#145 Posted 26 April 2018 - 10:10 AM
Mark., on 26 April 2018 - 10:06 AM, said:
Which one? There are two. One is somewhat special to me...
This post has been edited by MusicallyInspired: 26 April 2018 - 10:10 AM
#146 Posted 26 April 2018 - 10:11 AM
This post has been edited by Mark.: 26 April 2018 - 10:12 AM
#147 Posted 26 April 2018 - 11:13 AM
Mark., on 26 April 2018 - 10:11 AM, said:
Check the credits of that game...
#148 Posted 26 April 2018 - 11:43 AM
Just checked. Yes you did. Good job.
This post has been edited by Mark.: 26 April 2018 - 11:44 AM
#149 Posted 26 April 2018 - 03:19 PM
wall of text