Thursday, 9 February 2017

StackOverflow Finds - Pt1

http://stackoverflow.com/questions/33090193/linguistic-meaning-of-let-variable-in-programming

(defun should-be-constant ()
  '(one two three))

(let ((stuff (should-be-constant)))
  (setf (third stuff) 'bizarre))   ; bad!

(should-be-constant)   ; returns (one two bizarre)
??? :]

Wednesday, 18 January 2017

Richard Garriott AKA Lord British

I had started playing Ultima Online again, I re-visit this game every couple of years, since when I first bought it back when it was Ultima Online: The Second Age. My mum nicely paid a £10 a month subscription fee to the service back then, under the promise I would be good. The beauty of the game however was first shown to me in multiple reviews and article in an old mag called PC Zone.

So I recently decided to re-visit Ultima Online again, last time being at least 2-3 years ago. EA servers weren't running back then and I guess still not now. So I found a fan server which do tweak the game in parts, but this game was my first introduction to Richard Garriott and the Ultima series created when he worked at Origin.


What you can see about to be written a tag line that stuck with me for a while.

The Ridley Scott film 'Alien' and the tag line for Weyland Corp was also had similarities.



But here is Richard Garriott with his....


 This dude went to space, REALLY.......



So yeah, just had to have a rant and tell everyone how much of a legend I think this person is!

Later!


Wednesday, 16 December 2015

Buggy buggy FUCKING BUG!!!

So this is a post just to do with bugs that I found and both created whilst developing the mech game prototype. Now thinking about programming it again from everything I have learnt recently in terms of code structure and events, singletons etc with js! I HATE the code I've created before hand so considering starting from scratch for a while now, I promised to try and do a post a day, so this is a blooper reel.....

OK, the shoot yourself bug, simply didn't account for the user to decide to shoot themselves :)


Invisible mechs, caused by not building destruction methods the correct way or at all, so as more stuff was created, I think threejs auto destroyed some objects, perhaps the first models created, just needed to build proper disposal.


Ahh slanty explosion Sprites, I didn't want to use shader particles for explosions, so their base object had a method that made them lookAt(camera,position), I thought this was doing it every time the camera moved but perhaps not, or perhaps because I was stacking 3D models and assets together but the further the camera moved from the 0,0,0 world position, the sprite particles I made became more skewed.


I experimented with building destruction but at one point the mechs movements or my mapping of the walkable tiles was wrong and i could decide to blow up some of the flat road tiles which felt a little inception-y 



Never worked out what this tiny thing was lol


Was really hard to see these too but tiny pixel artefacts started appearing at one point, I fixed it but they just appeared round the movable characters, perhaps to do with invisible hitboxes :/


Tuesday, 15 December 2015

Parametric Geometry

Was browsing through the threejs cookbook and came across a chapter on parametric geometry and I had remembered a few years ago when working on a prototype for a games workshop warhammer game that we had a bit of trouble with one part. We had created a 3D landscape using random perlin noise and displacement, basic stuff. But when we wanted to start creating forest areas, we didnt want to place just tree after tree as that would have been an expensive polycount. But we did come up with the idea of using a programmatically generated geometry of a sort of forest canopy, something that could render the sides of a densely populated forest and also merge it into a tree top canopy.

For example you can see from the image below, that patterns can be found in how a large area of forest could be represented in 3D from the top.....
 
We completed it last time by sticking parts of these models together but wanted to really do it using good old math. So started to look into it again seeing as I had found this section on parametric geometry and whilst searching online I just found it a very interesting topic as parametric geometry and tessellation methods are creeping into more than just games but art, nature, design, architecture and more including the use of 3D printing....


 

I also found a university study someone had done on the actual process of dynamically generating tree's etc which shed's some light on the topic of mathematical 3d model generation.... 


The fact that threejs has enabled this sort geometry creation is definitely something I will be exploring again soon. 
In a game I have been working for a while I generate a dynamic city scape, but this city very much works on the grid based system found in New York. Parametric Geometry could be a key tool to generating more organic looking cities such as London's winding roads and alleys.