Forum Replies Created
-
AuthorPosts
-
IRC color codes work by using control code 0003 (ETX) to signify the start and end of a block of colored text. it then expects one or two arguments specifying the color code from a preset table.
https://en.wikichip.org/wiki/irc/colors
http://www.mirc.com/colors.html
Some other control codes are used to create text formatting. See the first link for more details.
ah, fair enough. I was under the assumption that the fmt block was incomplete or had bad data.
a game engine isn’t an audio editor, so I’d argue it’s still your responsibility to fix wave files with bad headers if you want them to play in your project. Without a proper header, the entire file needs to be read and the length and format guessed.
++++++++. Can’t live without Jungle currently :c
That would be awesome. I really want to get in on the hype for this system…
Ace, Tony! Pyro2 is shaping up to be the comprehensive framework for mx2. Keep up the good work
March 31, 2017 at 11:12 am in reply to: Ported particle System "Memory access violation" [SOLVED] #7668[EDIT] Thinking about this, maybe TimeFunc() should just be replacable, where the default just gets TimeManager.DefaultTime (that in turn returns a mainloop updated Millisecs() ) That would mean no passing of nowtime + a simple way to pause/scale the system, with out sacrificing special timescales if needed
Yes! One upgrade I was thinking of making in my monkey 1 framework was to give every system which relied on time a field for a timeIndex reference. One of the reasons I never got around to it was that it meant wrapping Millisecs() globally (to more easily support pausing) and probably keeping a seperate frame timer too, and as you said probably even going a step further if I needed support for time stretching/compression in my games. In mx2 this can be a simple Func type and ppl who don’t need that complexity can just keep the default timeIndex of a pointer to Millisecs().
March 29, 2017 at 11:37 pm in reply to: Ported particle System "Memory access violation" [SOLVED] #7658I’d rather you keep your version available for the time being, since I don’t plan to do an authoritative version for mx2 anytime soon. I’m waiting for Jungle to get some mx2 support before diving into that, and still have a few incomplete projects that aren’t even using mojo2 so I’ll be stuck there for at least a while.
The other system is very simple and actually written less with public use in mind, but I’ll think about it! It follows a “god particle” baseclass pattern which I didn’t favor for argyne, and doesn’t have intrinsic support for frame-based timing or second-order spawning. What it does have is Easing curve functions and an allocator. Here’s a code snippet of the main class, it won’t work without the nscreen framework (unreleased) but it should be fairly simple to understand.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208'Particle system from FVA, with easing curve dependencies offloaded to nScreen2.Import mojoImport UsefulFunctionsImport nscreen'Summary: Allows the allocation of one type of particle.Class ParticleAllocator<T>Field data:T[]Field iterator:Int'Summary: Prepares the allocator.Method New(size:Int = 32)data = data.Resize(size)End Method'Summary: Initializes the allocator with default values.Method Init:Void()For Local i:Int = 0 Until data.Length()data[i] = New T()NextEnd Method'Summary: Returns a free particle.Method GetNext:T()Iterate()Return data[iterator]End Method'Summary: Manually moves the iterator forward.Method Iterate:Void(amt:Int = 1)iterator = Cycle(iterator + amt, 0, data.Length())End Method'Summary: Batch renders all particles in the allocator. WARNING: No type constraints, can crash at runtime! Be carefulMethod RenderAll:Void()For Local i:Int = 0 Until data.Length()data[i].Render()NextEnd Method'Summary: Batch updates all particles in the allocator. WARNING: No type constraints, can crash at runtime! Be carefulMethod UpdateAll:Void()For Local i:Int = 0 Until data.Length()data[i].Update()NextEnd MethodEnd Class'Summary: The base particle class. Most of the time you can use this...Class ParticleField img:ImageField Visible:Bool '= TrueField startTime:IntField ttl:Int = 1000Field loc:= New pVal2(New nsEaseCubic()) 'Initial and final Location from origin.Field scl:= New pVal(New nsEaseQuad()) 'ScaleField angle:= New pVal(New nsEaseLinear())Field alpha:= New pVal(New nsEaseLoopback(2))Method New()scl.Set(1, 1)alpha.Set(0, 1)startTime = Millisecs()End MethodMethod New(x:Float, y:Float, xx:Float, yy:Float, usePolar:Bool = False)Set(x, y, xx, yy, usePolar)startTime = Millisecs()End MethodMethod Update:Float()Local p:Float = 1If Visiblep = (Millisecs() -startTime) / float(ttl)If p > 1 Then Visible = Falseloc.Update(p)scl.Update(p)angle.Update(p)alpha.Update(p)End IfReturn pEnd MethodMethod Render:Void(xOffset:Float = 0, yOffset:Float = 0)If VisibleLocal a:Float = GetAlpha()SetAlpha(a * alpha.current)DrawImage(img, xOffset + loc.current.x, yOffset + loc.current.y, angle.current, scl.current, scl.current)SetAlpha(a)End IfEnd MethodMethod Reset:Void()loc.Set(0, 0, 0, 0)scl.Set(1, 1)angle.Set(0, 0)alpha.Set(0, 1)startTime = Millisecs()Visible = TrueEnd Method'Summary: Rotates and alters the length of the destination point.Method RotMulDest:Void(rotAmt:Float = 0, mulAmt:Float = 1.0)Local t:Float = ATan2(loc.last.x - loc.first.x, loc.last.y - loc.first.y) + rotAmtLocal r:Float = pVec.Dist(loc.first.x, loc.first.y, loc.last.x, loc.last.y) * mulAmtloc.last.x = loc.first.x + Sin(t) * rloc.last.y = loc.first.y + Cos(t) * rEnd MethodMethod Set:Void(x:Float, y:Float, xx:Float, yy:Float, usePolar:Bool)If usePolarloc.Set(x, y, x + Sin(xx) * yy, y + Cos(xx) * yy)Elseloc.Set(x, y, xx, yy)End IfEnd MethodEnd ClassClass pVecField x:Float, y:FloatMethod New(x:Float = 0, y:Float = 0)Self.x = x; Self.y = yEnd MethodMethod Mul:Void(percent:Float)x *= percent; y *= percentEnd MethodMethod Set:Void(x:Float, y:Float)Self.x = x; Self.y = yEnd MethodMethod Set:Void(p:pVec)x = p.x; y = p.yEnd Method'Summary: Sets a vec to values from polar coordinates.Function SetPolar:Void(v:pVec, theta:Float, r:Float)v.x = Sin(theta) * rv.y = Cos(theta) * rEnd Function'Summary: Returns the distance between two pointsFunction Dist:Float(x:Float, y:Float, x2:Float, y2:Float)Return Sqrt( (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y))End FunctionEnd Class'Summary: 1d tween valueClass pValField first:FloatField current:FloatField last:FloatField curve:nsEasingCurveField in:Bool = True, out:Bool = TrueMethod New(curve:nsEasingCurve)Self.curve = curveEnd Method'Summary: Sets initial values.Method Set:Void(f:Float, l:Float, in:Bool = True, out:Bool = True)first = fcurrent = flast = lSelf.in = in; Self.out = outEnd MethodMethod Update:Void(percent:Float)current = first + ( (last - first) * curve.Ease(percent, in, out))End MethodEnd Class'Summary: 2d tween valueClass pVal2Field first:= New pVec()Field current:= New pVec()Field last:= New pVec()Field curve:nsEasingCurveField in:Bool = True, out:Bool = TrueMethod New(curve:nsEasingCurve)Self.curve = curveEnd Method'Summary: Sets initial values.Method Set:Void(x:Float, y:Float, x2:Float, y2:Float, in:Bool = True, out:Bool = True)first.x = x; first.y = ycurrent.x = x; current.y = ylast.x = x2; last.y = y2Self.in = in; Self.out = outEnd MethodMethod Update:Void(percent:Float)current.x = first.x + ( (last.x - first.x) * curve.Ease(percent, in, out))current.y = first.y + ( (last.y - first.y) * curve.Ease(percent, in, out))End MethodEnd ClassYou can see an example of it working here. The example extends Particle with a subclass that puts it on a rail, using Particle.RotMulDest() to spin back towards its destination. Since the system was made specifically for this game, it’s a lot less elegant (especially to extend or if you need frame timing) but also a lot more compact and “to the point”. The allocator here is also sloppy and just kills particles regardless of how close they are to expiring, which argyne would’ve done instead as a property of the Particle interface (which would’ve fetched a resource based on time-to-live, iirc).
I would like to release something eventually for monkey/mx2 that is a “best of both worlds” of both of these systems. Perhaps if mx2-only, have particles accept functions which define their behavior and reduce the number of classes/interfaces…
March 29, 2017 at 2:03 am in reply to: Ported particle System "Memory access violation" [SOLVED] #7650Hi!
Yes, it seems that bit of code from the original was a bit janky. At some point in the design of argyne, I ran into a problem where I couldn’t make interfaces generic (a limitation of Monkey at the time) and ended up having to rewrite a large portion of the system. This bug may have been an artifact of sloppy refactoring.
One of the reasons I abandoned argyne was because it creates a lot of object initializations and does nothing to track or pool particle resources, making the entire system very resource-intensive compared to the (as of yet still unreleased) system I wrote to replace it. Thrash was inevitable as the GC would have to sweep these eventually and that would cause big hiccups on Android (and eventually in glfw too if the example was anything to go by).
Thanks for updating argyne for mx2. If I were to rewrite it myself, it would probably handle a few things differently! The general way to set it up would probably stay similar, though…… and there’d also be a way to delay its startTime, and an easing curve option in ParticleValues.Set()…..
yay slices. Best of luck
check this thread out, it may be helpful even though it’s old: http://www.monkey-x.com/Community/posts.php?topic=9473&post=98448&view=all#98448
It relates to Images rather than Canvas but the notes on how the GC works near the end are probably still useful.
hezkore: Ctrl/Cmd+W is a typical way to close windows on non-Windows systems, but in Windows the typical shortcut is Ctrl+F4
Most people probably won’t take advantage of GLES3-specific features but it’s definitely not going to “cut your userbase in half” like some people are saying. If you’re targeting 3d for a new project then you’re probably not targeting a legacy userbase. If you are, why not backport it yourself? This seems like a special case scenario considering the circumstances. Usage of GLES2-only devices is on the decline.
Also, one thing that hasn’t been mentioned yet is that GLES3 guarantees availability of ETC2 texture compression, whereas on GLES2 you maybe got ETC1 but it wasn’t guaranteed to be available, and it didn’t support alpha channels anyway which often necessitated figuring out what type of hardware compression the device did support (cludge around or have a table of GPUs lying about) and creating duped assets for each of these, then specifying it in the manifest to reach the widest audience.
It could be a mess; PowerVR, nVidia, and AMD all had their own standard, and in AMD’s case, they had two(!). Part of the convenience of GLES3 is you don’t have to mess with any of these; you just use Ericsson 2 compression and you’re good to go.
neat project! Where from and how much was the controller? And, how’s the latency? I know there are more dedicated kits for rolling your own MIDI controllers and synths but I’m curious if this would be a good starter to patch in a daughterboard (with a dedicated synth chip on it) via GPIO or if rpi is not suitable for this task. Tons of fun possibilities though
I don’t like line continuation characters at all. If there’d be only one change to make, I’d request that “+” qualify as a continuation character, or make all operators qualify. Don’t know how messy that would be, but I’d presume that using “..” will be unfun for parsers and/or preclude using it in the monkey1 way for slicing (is that even a thing anymore?)
-
AuthorPosts