Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Valtis
Sep 21, 2009
I expanded my compiler middle-end a bit.

This little program returns 324, (as it should):



While previously the compiler would have generated all the arithmetic operations, comparisons and jumps, now it generates the following:



that is, I managed to implement an optimizer and it actually works in this case.

Internally, the compiler uses three-address code to represent the program. I added a conversion pass that converts this code into static single assignment form, which allows me to easily write optimization passes like constant propagation, folding and dead code elimination. After the optimization passes have done their job, the code is converted back to three-address code form and then handed over to the backend. I might end up refactoring this as well, as there seem to be register allocators that operate on SSA form, so it might make sense to keep the code in the SSA form until that has been performed as well.

Adbot
ADBOT LOVES YOU

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I figured out how to expert models from Blender in a format that the Sega model processing tool will accept. In theory I'm working on something for a game jam but, I have no idea what. Here, have a spinning jar of jam.



There's no UV mapping! Textures are mapped using the VDP1's sprite drawing engine. Instead I have to apply textures to polygons individually. Wrapping a texture around the jar consists of using a tool to split the texture into a series of distorted textures that get applied to a series of polygons. :barf:

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

When you make the jar transparent the jam will look more delicious! :unsmigghh:

munce
Oct 23, 2010

Luigi Thirty posted:

I figured out how to expert models from Blender in a format that the Sega model processing tool will accept. In theory I'm working on something for a game jam but, I have no idea what. Here, have a spinning jar of jam.



There's no UV mapping! Textures are mapped using the VDP1's sprite drawing engine. Instead I have to apply textures to polygons individually. Wrapping a texture around the jar consists of using a tool to split the texture into a series of distorted textures that get applied to a series of polygons. :barf:

Looks good now make virtua cop. Seriously though is that process you're using anything like the original developers would have used? Seems like it would be incredibly tedious to make a real game with.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

munce posted:

Looks good now make virtua cop. Seriously though is that process you're using anything like the original developers would have used? Seems like it would be incredibly tedious to make a real game with.

Yeah, by all accounts the Saturn's architecture was a shitshow. It can do transparency too, but it involves extremely complicated interactions between multiple processors or something.

I've been :effort: contemplating making a Saturn thing for a long while now. Happy to vicariously experience it through Luigi 30.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

munce posted:

Looks good now make virtua cop. Seriously though is that process you're using anything like the original developers would have used? Seems like it would be incredibly tedious to make a real game with.

Yeah, it's all tools scavenged from the various Sega leaks over the years.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

leper khan posted:

Happy to vicariously experience it through Luigi 30.

This is my response to every Luigi Thirty post.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

leper khan posted:

Yeah, by all accounts the Saturn's architecture was a shitshow. It can do transparency too, but it involves extremely complicated interactions between multiple processors or something.

I've been :effort: contemplating making a Saturn thing for a long while now. Happy to vicariously experience it through Luigi 30.

VDP2 (the 2D chip) can handle transparency between 2D layers just fine but it can't handle transparency between overlapping sprites. Sprites are handled by VDP1 and the screen transferred to VDP2 as one framebuffer. So you can have a sprite behind a translucent background but you can't have a transparent part of a sprite on top of another sprite. It would just overwrite the first sprite.

Sega's solution was... a bit you could set that dithered a sprite so every other pixel was drawn. You could also do transparency with software rendering if you were really clever, a couple games did that.

Luigi Thirty fucked around with this message at 20:50 on Feb 1, 2017

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Yeah if you look at most Saturn games (especially 3D ones) proper transparency is really rare. Everything uses that cheap-looking mesh dithering, shadows look like someone threw a net on the floor, it all looks dirty. Next to the fancy PlayStation versions it was all pretty disappointing!

Luigi Thirty
Apr 30, 2006

Emergency confection port.

baka kaba posted:

Yeah if you look at most Saturn games (especially 3D ones) proper transparency is really rare. Everything uses that cheap-looking mesh dithering, shadows look like someone threw a net on the floor, it all looks dirty. Next to the fancy PlayStation versions it was all pretty disappointing!

Here's an article describing just that using a level from the Saturn and PSX versions of Mega Man X4 as a comparison. Same level, same graphics, the PSX version has transparent textures and looks way better as a result.

It took me all evening but I figured out how to at least draw a 2D object, blow it up, and scroll it across the screen. :toot:



(The jerkiness is the GIF capture, it's perfectly smooth in the emulator.)

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

I see you're remaking Nights Into Dreams

Yeah that framebuffer thing is hosed up. I guess we're all spoiled now with how easy it is to just do blending, the PlayStation designers got it somehow though and it made a big difference. That article is lying, the mesh thing was way obvious on a TV, although maybe it was down to our incredible SCART connections

Maybe you could make a stealth game! Hiding your sprite behind other sprites

Ranzear
Jul 25, 2013



These look like boats, right?

bobua
Mar 23, 2003
I'd trade it all for just a little more.

Yeah, very much so. Board game battleshippy even.

Only the green one has a hint of 'space ship', so you may want to stick with the streamlined design.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

They look like speedboats or PT boats, except green which looks like a space boat.

Ranzear
Jul 25, 2013

Yeah, the green one is a little too Hydro Thunder, but I was kinda going for that. It's a bit more detailed than the others, so maybe I'll flatten it out. Maybe even out the highlighting on the red one too, but it's only super apparent with mid-tones due to using color burn instead of multiply. They're all supposed to be fast missile boats, with a rotating missile launcher where the circle is. Green will have a dual launcher to match the dual hull. 'PT Boat' is appropriate because they should be somewhere between that and an LCS. I tried something new in doing these sprites on a diagonal, lending to the gentler curves I think. Those are just 64x64 sprites upscaled 2x. Now I just need four launchers, four missile heads, and four missile tails and I'll start working on my water effect.

I did this art-first approach with the caliber.online tank game, which is coming down for rework and this is going up in its place. I guess it'll turn into one site for all my little top-down wargames and I've got some other goodies to roll in like Twich login.

Thanks guys. I appreciate feedback more than you realize.

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)
The green one reminds me of the Chinese type 22 missile boats. I think it's pretty dead on. If you had some sprites for them rolling to each side, I think it would really drill it in.

Hollow Talk
Feb 2, 2014

Ranzear posted:

Yeah, the green one is a little too Hydro Thunder, but I was kinda going for that. It's a bit more detailed than the others, so maybe I'll flatten it out. Maybe even out the highlighting on the red one too, but it's only super apparent with mid-tones due to using color burn instead of multiply. They're all supposed to be fast missile boats, with a rotating missile launcher where the circle is. Green will have a dual launcher to match the dual hull. 'PT Boat' is appropriate because they should be somewhere between that and an LCS. I tried something new in doing these sprites on a diagonal, lending to the gentler curves I think. Those are just 64x64 sprites upscaled 2x. Now I just need four launchers, four missile heads, and four missile tails and I'll start working on my water effect.

I did this art-first approach with the caliber.online tank game, which is coming down for rework and this is going up in its place. I guess it'll turn into one site for all my little top-down wargames and I've got some other goodies to roll in like Twich login.

Thanks guys. I appreciate feedback more than you realize.

They are really neat. The only thing (at least on my monitor) is that the black detailing on the dark blue ship is very hard to see, so perhaps a slightly lighter "highlight" colour would help there, much like you did with various shades of grey on the other ships.

Ranzear
Jul 25, 2013

Hollow Talk posted:

They are really neat. The only thing (at least on my monitor) is that the black detailing on the dark blue ship is very hard to see, so perhaps a slightly lighter "highlight" colour would help there, much like you did with various shades of grey on the other ships.

They're actually grayscale ships (five consistent tones) that I apply a color burn to, which is what I developed for the old tank game. 'Full' colors will tint the whole thing while darker middle values cause that strange inversion on the brightest base tone. Dark blue just doesn't work well, and that ship is lacking some highlights too (it's supposed to be the stealthy one though). I'd push it towards a cyan or something but I'm actually going to let people pick their own color with sliders this time, and teams will be assigned with an underlying circle or something as necessary.



On one hand I want them to be distinguishable regardless of paint scheme, on the other I don't really need to because this is supposed to be non-visual engagement 90% of the time. The real purpose would be so your teammates know you're fast or have good radar or heavy hitting or can take some hits.

The gist of the game is you're selecting a sensor, warhead, and propulsion for each missile you fire (each takes time to build too) and launching them into the fog of war to get information back, take out incoming missiles, or hit enemy ships. Largely inspired by this nuclear tipped insanity

Hollow Talk
Feb 2, 2014

Ranzear posted:

They're actually grayscale ships (five consistent tones) that I apply a color burn to, which is what I developed for the old tank game. 'Full' colors will tint the whole thing while darker middle values cause that strange inversion on the brightest base tone. Dark blue just doesn't work well, and that ship is lacking some highlights too (it's supposed to be the stealthy one though). I'd push it towards a cyan or something but I'm actually going to let people pick their own color with sliders this time, and teams will be assigned with an underlying circle or something as necessary.



On one hand I want them to be distinguishable regardless of paint scheme, on the other I don't really need to because this is supposed to be non-visual engagement 90% of the time. The real purpose would be so your teammates know you're fast or have good radar or heavy hitting or can take some hits.

The gist of the game is you're selecting a sensor, warhead, and propulsion for each missile you fire (each takes time to build too) and launching them into the fog of war to get information back, take out incoming missiles, or hit enemy ships. Largely inspired by this nuclear tipped insanity

That's really neat and I see what you mean. If it's dynamic anyway, then it's certainly not a problem! :sun:

Ranzear
Jul 25, 2013


Missiles, every combination of propulsion and seeker


Rescaled ships. They need one more detail pass.


2x scale with kinda random colors

I thought to have warhead choice affect the core pattern, but then I'd have to reveal to clients (enemies included) the warhead on each missile, so that's an infosec over art choice.

I might have to go back and upscale the boats now, and add more detail, just so they're scaled right at the same res. Pixelated, but consistent. Done!

Ranzear fucked around with this message at 20:01 on Feb 7, 2017

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I figured out how to set up parent-child relationships between object transformation matrices. Here's a cute little tank.



(Its turret should be Gouraud shaded red, not flat black...)

AntiPseudonym
Apr 1, 2007
I EAT BABIES

:dukedog:

Luigi Thirty posted:

I figured out how to set up parent-child relationships between object transformation matrices. Here's a cute little tank.



(Its turret should be Gouraud shaded red, not flat black...)

How does the Saturn deal with depth? Is it sorting the polygons via nearest-vertex, centroid or is it just left as an exercise for the dev?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

AntiPseudonym posted:

How does the Saturn deal with depth? Is it sorting the polygons via nearest-vertex, centroid or is it just left as an exercise for the dev?

Ha. It can't do depth sorting in hardware, no. The dev has to do that when rendering. SGL does it for you.

Athas
Aug 6, 2007

fuck that joker
I feel like a witness to self-harm.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Athas posted:

I feel like a witness to self-harm.

Buried in the programmer manual is a line saying that if the camera is parallel to the Y axis it will have some trouble with depth sorting. The solution is to offset it by a fraction of a degree.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Luigi Thirty posted:

Buried in the programmer manual is a line saying that if the camera is parallel to the Y axis it will have some trouble with depth sorting. The solution is to offset it by a fraction of a degree.

Nice !!

I love "incorrect but it works" common sense type "solutions"

MrMoo
Sep 14, 2000

Weee, a fully web standard powered market data distribution platform and into an iPhone.

Sirocco
Jan 27, 2009

HEY DIARY! HA HA HA!


More in-depth statistics when checking what starting- and ending-letters pair well together.



Added a second colour theme which removes the red/greenness of the standard theme for those who are colourblind, accessible with the new Options menu.

MrMoo
Sep 14, 2000

My nephew barely knows any HTML or CSS but has managed to make some progress copying the NYSE floor designs, I updated with Polymer and WebComponents to hook up with WebSocket streamed live data.





Polymer is pretty nice, just make up your own HTML tags:

HTML code:
<long-form symbol="TRI"></long-form>
<long-form symbol="BAC"></long-form>
<long-form symbol="F"></long-form>
<long-form symbol="S"></long-form>
<long-form symbol="PFE"></long-form>

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
code:
>Success ast <- flip evalStateT defaultState $ runPopperParser expressionParser "(\\x -> x) 2"
>Just type' = typeCheckAST ast
>_expType <$> type'
IntegerType :< LambdaApp (LambdaType IntegerType IntegerType :< Lambda (VariableIdentifier "x") (IntegerType :< BoundName (VariableIdentifier "x"))) (IntegerType :< IntegerLiteral 2)
It doesn't look like much, but I decided to work on my programming language again (unfortunately from scratch), and now I've got really basic type checking.

Sinestro fucked around with this message at 06:21 on Feb 19, 2017

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

MrMoo posted:

make up your own HTML tags:

HTML code:

<long-form symbol="TRI"></long-form>
<long-form symbol="BAC"></long-form>
<long-form symbol="F"></long-form>
<long-form symbol="S"></long-form>
<long-form symbol="PFE"></long-form>

This is such a handy "feature" of HTML. Way more readable than a pile of divs.

Hollow Talk
Feb 2, 2014
Since we are talking about HTML :byoscience:

I have continued work on my "EVE Online Intelligence Tools Extravaganza for Nobody in Particular". While I have done a lot of boring backend stuff on the recon suite I have shown earlier, such as integrating EVE's own oAuth2 login, changing some database layouts, adding even more SQL triggers (I would very much like materialized views, thank you very much :saddowns:) etc., none of this is very visible or exciting.

More interestingly, I replaced the absolute mess of different cron jobs for various background updaters with a monolithic dispatcher, which means we don't have to reload the whole Racket environment every time we update anything at all via a separate script. Instead, I'm using a task scheduler and a variable number of workers that work off of three message queues (one only gives a command to run and they then run a single command, the other two contain pre-partitioned lists of entries which the worker then resolves one by one). I had barely looked at threading in Racket before this, and I have to say, I am really pleasently surprised how simple it is to create a queue/worker model here:

code:
(define (log-output str #:id id)
  (let ([out (current-output-port)])
    (fprintf out "[Thread ~a] ~a -> ~a~n" id (date->string (current-date) "~5") str)
    (flush-output out)))

(define (create-worker [id (gensym)])
  (thread (lambda () (let loop ([th (current-thread)])
		       (sync/timeout 120
				     (wrap-evt character-queue
					       (lambda (msg) (begin (log-output 'characters #:id id)
								    (exn-wrapper (characters-api-helper msg))
								    (sleep 1)))) ;; Limit API accessing speed
				     (wrap-evt corporation-queue
					       (lambda (msg) (begin (log-output 'corporations #:id id)
								    (exn-wrapper (corporations-api-helper msg))
								    (sleep 1)))) ;; Limit API accessing speed
				     (wrap-evt control
					       (lambda (msg) (begin (log-output msg #:id id)
								    (match msg
								      ['exit (kill-thread th)]
								      ['alliances (exn-wrapper (alliances-api-helper))]
								      ['citadels (exn-wrapper (citadels-api-helper))]
								      ['sovereignty (exn-wrapper (sovereignty-api-helper))]
								      ['supers (exn-wrapper (supers-api-helper))]
								      ['towers (exn-wrapper (towers-api-helper))])))))
		       (loop th)))))
That's the whole worker definition + logging output (I simply run the whole thing as a systemd service, where logging to stdout is expected and where I can simply read them via journalctl). And since I'm lazy (hey, it's for scalability!!!) this is how workers get started: (define workers (map create-worker (range 2)))

A second project is (somewhat) distinct, making use of the same backend, however. In EVE Online, a notoriously lovely video game, control over player-owned space is decided via engaging various command nodes that float in a given constellation of solar systems. This is essentially a game of whack-a-mole, and it's deeply irritating. Perhaps worse, it's an absolute nightmare to maintain some sort of overview over various activites in and the status of various systems. Enter a node tracker:

https://i.imgur.com/ZqKUTl4.mp4

Imgur has a tendency to speed up GIFs I make for some reason, but I think one gets the idea. Link to GIF

The whole system basically assigns a masterID (a simple SHA256 hash, to make sure we won't have any collisions) which joins an admin session and any number of scout sessions. The admin session aggregates the node inputs and updates of all linked scout sessions, while each scout is only able to see his or her own reporting. All IDs (master, admin, scout) are simple (truncated) SHA256 hashes, which means they shouldn't be predictable or guessable, yet they remain linked so the admin can share his session with any number of people he thinks should be able to see aggregate information as well. The same goes for scouts, multiple scouts can either act independently (multiple sessions in the same solar system) or they can collaborate (by sharing the url), though the first option is preferred.

It's simple and doesn't look like much, but it was genuinely fun to code, especially getting all the "session management" right. And since EVE players are a paranoid bunch, not only do we use non-guessable URLs, but an admin can additionally set passwords either for the admin session, for scout sessions (same password for all), or both at the same time.

And for some additional screenshots showing more than one scout:

Scout 1:


Scout 2:


Admin:


And for the true :wtc:, an example of writing the report form via Racket's scribble HTML functions. A "pile of divs":

code:
(form 'method: "POST" 'action: "/report"
		     (div 'class: "form-entry"
			  (div 'class: "form-description" "Scout Name")
			  (div 'class: "form-field" (input 'type: "text" 'name: "scout" 'required: #t)))
		     (div 'class: "form-entry"
			  (div 'class: "form-description" "System")
			  (div 'class: "form-field"
			       (select 'name: "system" 'required: #t
				       (map (lambda (sys) (option 'value: sys sys)) (constellation->systems constellation)))))
		     (div 'class: "form-entry"
			  (div 'class: "form-description" "Node Count")
			  (div 'class: "form-field" (input 'type: "number" 'name: "count" 'min: 0 'max: 99 'value: 0)))
		     (input 'type: "hidden" 'name: "masterID" 'value: masterID 'readonly: #t)
		     (input 'type: "submit"))
The forum screws up identation ever so slightly, there is...less of it, usually.

Hollow Talk fucked around with this message at 01:27 on Mar 7, 2017

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Lots of under the hood changes to make the program less spaghetti and more sensible. Bonus: now the player can shoot bullets complete with a little crosshair to help aiming :toot:

Xom
Sep 2, 2008

文化英雄
Fan of Britches
From the board game design thread:

Xom posted:

I made a thing like nanDECK. Now what I really need is real users, which will help me figure out what improvements I should focus on. Any feedback is welcome.

The thing that makes this possible is a library, dom-to-image, which "uses a feature of SVG that allows having arbitrary HTML content inside of the <foreignObject> tag". The SVG can be converted into a dataUrl.

I'm kinda miffed at Firefox because of "For security, browsers don't allow resource files loaded via file:/// to be freely manipulated in JavaScript. The restriction is supposed to be lifted if the user actively supplies the file via file chooser, but in my experience Firefox doesn't lift it. Chrome does."

TheresaJayne
Jul 1, 2011
I saw this video a while back and decided to work on it

https://www.youtube.com/watch?v=cWpRxyqDgpM

This is my output from a windows Exe file

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Now run it on something encrypted :)

(The way that guy uses 'cyber' makes me cringe so hard so much :tizzy:)

MrMoo
Sep 14, 2000

Dynamic CSS and Polymer is surprisingly challenging. Chrome pulled CSS variables in v49 and now they have reintroduced a subset via a Polyfill, I was hoping to use CSS like color: var(--tick-colour); but due to performance reasons the variable is never recalculated automatically.



Also some crap with cascading not working from :host down so that toggleClass() is completely gimped.

Official start date on this project is next week, :toot:

MrMoo fucked around with this message at 02:39 on Feb 25, 2017

RexJericho
Mar 20, 2011
I made this honey simulation in a liquid fluid simulator that I am writing. The image is rendered using Blender:



Animated GIF of the simulation

A bare-bones version of the simulator source code can be found on GitHub here!

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
That looks awesome! Anything interesting to share about the implementation? (I know absolutely nothing about fluid simulation.)

Adbot
ADBOT LOVES YOU

Tres Burritos
Sep 3, 2009

Man the only thing giving that away is the weird jagged edges.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply