Mapgen4: finished
“Not with a bang but a whimper”
Back in July, I started mapgen4, the successor to mapgen2, my Voronoi-polygon map generator from 2010. Back in August I posted that I had planned to finish the map generator “in a month”, and then write a tutorial.
That was three months ago.

I'm finished.
Looking back on the blog post from three months ago, I implemented all the things in my plan, and more. There are still so many more things to implement. But after four months, I'm tired of working on this project. The past few weeks I've only done a little bit. I've not run into any more show-stopping bugs. I've fixed some annoyances. I think it's in reasonable shape. So I decided that I'm finished.

At some point I want to write a tutorial explaining all the parts of this map generator, but for now, the blog posts will have to do. I have other projects I want to do too!
The Great Northern Expo award for Games Design 2108
tháng 11 26, 2018
The Great Northern Expo award for Games Design 2108
No comments
'The Great Northern Creative Expo' awards 2018.
Peter Dimitrov,
James Moorby and
Jakob MacDonald were nominated for their creative excellence and passion for their subject.
Math explorables
There are times when I'm on YouTube watching a math video that I think, “oh, that would be fun to play with!” What I should do is recreate the diagram in Desmos or Geogebra. But instead I just move on to another video. Recently I decided I should try making some diagrams, in part to improve my Javascript/web skills, but in part because it seemed like it'd be fun! So I did this for two math videos:



Both of these were quick, under an hour (mostly fiddling with colors, line widths, transparency, etc): an ellipse from line segments, multiplication with modulo on a circle.
Download BOS Wars 2.7 RTS for Windows
tháng 11 22, 2018
bos, bos-wars, boswars, rts, strategy
No comments
Bos Wars is still a nice fast-paced and somewhat lightweight RTS for you to enjoy, even though the sound mixing is still brutal but getting your hands on the latest Version for Windows is not as straightforward, as it was in 2010.
Thankfully, you can get a working version for Windows from Portableapps.
The cool 3D pixel soldier in the thumbnail above is from OpenGameArt by the way. Still kicking, old design and all.
The Great Northern Festival - Games Design UCLan
tháng 11 14, 2018
The Great Northern Festival - Games Design UCLan
No comments
and Hannah Spikings of Spikings Art
for joining us in the UCLan games studio yesterday for the Great Northern Festival and for inspiring the students and staff with their presentations which we all enjoyed.
Here is a link to Tuesday's highlights video of The Great Northern Creative Expo:
https://youtu.be/H8NSje_UV7M
David and Hannah are both featured in it!
David shared his extensive experience in the world of virtual reality and talked about the evolution and future of VR.

Hannah gave some insightful guidance about working as a freelance designer.




Procedural face generator
I've had my red blob logo since 1987. I doodle various facial expressions on the blobs, and also experiment with mathematical representations.

In 2011 while reading Scott McCloud’s Making Comics I saw the part about interpolating between facial expressions on page 85. I hadn't considered that facial expressions could be interpolated. I played with splines to generate mouth expressions in a simple comic style. Recently I wanted to update this project with better code and a better UI. While I was updating it, I also realized the brow-lift parameter was backwards (increasing lift would lower the brows). The smile parameter (s) was also backwards (increasing s would make it frown).
I would like to use these faces in my tutorials but haven't yet decided where.

Mapgen4: beta
I put mapgen4 on hold a few weeks ago because I was having some seemingly random unreproducible freezes, where it would still calculate the map updates but it wouldn't draw them. I had tried everything (or so I thought), gotten frustrated, and taken a break. I often find that I need to take a break from something, and then when I get back to it, I figure out the problem. During this break I've been "productively procrastinating", working on several other things that I've wanted to do, including map generation on a sphere, a procedural face generator, improving touch support on many of my pages, and improving my tower defense pathfinding page. I ended up also experimenting with a better interface for my mouse-drag code, a recursive renderer in Vue.js, and a D3 + Vue.js experiment in which Vue keeps track of dependencies for D3.

It's time to get back to work on mapgen4.
Within 10 minutes I had written a test environment to try to trigger the bug. It didn't. But the test environment in combination with moving the sliders around triggered the bug reliably. There were 2 sliders out of 27 that would cause the symptoms I was dreading. But in making the problem reproducible, I had made it much easier to find the problem. Within another 10 minutes I had fixed it. Yay!!
I believe I have fixed the bug, but it's possible there's another bug hiding in there.
Why was I able to find this now but not earlier?
- I was frustrated earlier. After taking a break, I'm calm. Being frustrated makes it harder for me to figure things out.
- I was looking in the wrong place. I was convinced it was a problem with my multithreading (in part because multithreading is such a common source of bugs), but it wasn't.
- By taking a break, my brain generated new hypotheses in the background. At some point, maybe a week ago, a thought came to me: there's some weird behavior with rivers. When I came back to this project, I discovered that the weird behavior was linked to the bug. The problem is that occasionally, no rivers are large enough to be drawn, and my code tries to draw 0 rivers. This seems to mess up the graphics state. I fixed it by only drawing if the number of rivers was greater than 0.
I'm posting this in part to remind myself to take more breaks and to get frustrated less.
I can now get back to implementing the remaining features. Yay!
Go play with the mapgen4 beta! If you run into a bug, let me know!
Tower Defense page: distance fields
One reason I prefer having web pages instead of videos or academic papers is that they're easy to update over time. I'm still updating pages I wrote over 20 years ago.
Yesterday I was reviewing the Tower Defense page (2014) and decided the gap between the diagram at the top:

and the next diagram:

was too large. The first diagram explains the end goal. The second diagram explains the “frontier”. But why do we need the frontier? It's because we're trying to generate a distance or vector field. I decided to add a diagram in between that shows a distance field:

I think the page flows a little better now but it still needs more work. Since I'm working with a web page and not a video or academic paper, there's no need to wait until everything is finished; I can update the page as I come up with improvements. Take a look at the updated Tower Defense page and let me know what you think!
DevCorner: FreeDink sound design replacements
tháng 11 09, 2018
devcorner, freedink, freesound, rpg
No comments
I could not have done it without the excellent documentation and progress report.
I will continue testing and hopefully, soon all the audio will be fully free on this um... cult classic™!
Dev's Corner is a featured article series focusing on tutorials and tips for game developers operating on a Libre Software environment.
Touch events on the pathfinding pages, part 2
I've been avoiding mapgen4 for a few weeks now. I ran into a really annoying bug that frustrated me enough that I wanted to give up. I still need to get back to it, but I'm “productively procrastinating”. Instead of sitting around being frustrated, I'm getting other things done: map generation on a sphere, a procedural face generator, and adding touch event support to my pathfinding pages.
When I wrote the A* tutorial, I didn't consider touch events at all. The traffic I got from mobile/tablet was small. I soon added some touch event handling, but it was incomplete. I figured I'd fix it later. Well, it's been four years now. It's time to fix it finally! (Update: I think my touch event handlers used to work, but I think they stopped working when Chrome 56 and Safari 11.1 changed event handlers to default to passive sometime in late 2017 / early 2018; see this and this)
The main problem is that although I added a touch event handler, it still scrolled the page. So you'd try to paint a wall and it'd be scrolling at the same time. Annoying!
The way mouse events work on the A* page is that I capture mousedown on any tile and then put mousemove and mouseup on the window object. On mouseup I remove the event handlers from the window object. The mousemove will get sent to the window, but it will tell me which tile is under the mouse at the time. I was using that to tell me which graph node to point to.
The way touch events work is that I capture touchstart on any tile and then receive touchmove and touchend events as you move your finger around. These events get sent to the original tile, not to the tile your finger is under. The logic has to be different for touch events. I was using some browser-specific code to map the event location to an SVG element, and then using d3.js to map the SVG element to my graph node.
For grids it's easy to map a pixel location to the grid coordinates directly, without using browser-specific code. So I only needed the browser-specific code for the non-grid map at the top of the page. I decided to implement point-in-polygon to handle the non-grid map. Although there are some easy solutions on stackoverflow and also on Paul Bourke's site, many of them are not numerically robust, as pointed out in Schirra S. (2008) How Reliable Are Practical Point-in-Polygon Strategies? (Thanks to Mikola Lysenko for this link.) I ended up spending too much time reading about this before deciding the numerical stability wasn't a problem for this page.
While working on this I also discovered:
- Some diagrams use mouse hover, which doesn't work on touch devices.
- Some code was populating a diagram that no longer existed. The way d3.js works, if you
selectAllsomething that doesn't exist, it will create an empty selection. Then when you set attributes or create elements inside that empty selection, it does nothing. So this bug went unnoticed until now. - Some CSS was for a different diagram I no longer have.
- The paint operation occasionally wrapped around the left/right sides of the grid. It only happened when the pixel-to-grid fallback code was called. After making this the primary path (removing the browser-specific code), it happened frequently, so I fixed it.
I also fixed touch events on some of the other pathfinding pages:
[X]tower-defense[X]distance-to-any[X]grids/algorithms[ ]1712-astar-graph[ ]1537-tonypickford1[X]l1-clarkson[ ]making-of[X]heuristics/differential
It turned out the diagrams on the making-of page were broken. I fixed them, but the mouse events aren't right. I think I need to use window.getComputedStyle(element).transform to get the 3D matrix transform, invert that, and then apply that to the mouse pixel coordinates. And it's somewhat browser specific, as there's both WebKitCSSMatrix and DOMMatrix, neither supported by all browsers. Neither is GeometryUtils. Ugh. I spent an hour on this and decided although it's a cool page, very few people see or use it, so I shouldn't spend any more time on it. I can take a look another day.
So the good news is that most of the pathfinding pages now properly work with touch screens. Try Introduction to A* on a phone or tablet. The bad news is that the "exploded diagrams" page doesn't respond to mouse events properly. Overall, a good day!
Nerdy Space Game for Hackerspaces - 6 Years of Development
tháng 11 06, 2018
scifi, spacenerdsinspace, video
No comments
More videos on Stephen Cameron's channel.
Review : Dragon Quest XI: Echoes of an Elusive Age (PS4)
Skor dari saya : 10/10 (Masterpiece)
Played at : PS4 Pro, HDR, 4K TV



































