Re-using previous projects knowledge
Posted: Fri Oct 28, 2016 7:34 am
As you may now all know, I'm working since more than half a year on my latest craziness ( https://www.dotworldmaker.com ). I had however an interesting question about how I recycled previous projects into this one. So I thought why not try to remember where I used previously some technologies or piece of code and here is an incomplete list which came out:
- Map editor: clearly I took the knowledge I had in Nowhere Else and Beyond (NEaB) which was my first map editor at that time. The technology behind is not the same (was using the DOM and JS while now I use canvas and Typescript), even the backend is completely different (was PHP now it's Node.JS). Still many concept like automatic tile transitions, or road painting are from the NEaB.
- Scripting language: when I wrote wsirc, I had the need to be able to customize it for some of it's usage. For this I created a language nearly like JS and its parser to be able to run it within my tool without having any security issue (not like if you let anyone put custom JS on your page). I had to learn how to build a tokenizer, parser, and AST and then execute it. While I had previous experience with YACC ( https://en.wikipedia.org/wiki/Yacc ) I never went as far in the direction of creating a full language. The same knowledge has been then ported to Ludiculus and finally to my latest project.
- Canvas & sound: the first thing I really made with canvas and html5 sounds was Cubicverse. While the project was somehow working it clearly didn't reach any useful market. People didn't liked so much the idea nor the art. Also the code was all JS, not easy to maintain at the end, and after 1 and half year I stopped.
- Maze generation: taken again from NEaB, I had the need there to have random dungeons generated daily. For that I made some script which was generating them, and part of it was a maze generator. The code has been then ported to Cubiverse later to Ludiculus and finally latest implementation in the current project.
- Path finding: guess what, again from NEaB to Cubicverse and to Ludiculus. I basically implemented a A* path finding and use that for my AI.
- Chat: This is not all that far from a simple socket.io chat, but with the path knowledge of what is needed from NEaB. On NEaB I was doing AJAX polling (as there was no web sockets at that time).
- NPC dialogs, and questing: The concept comes from NEaB and the quest / NPC system I had. There it was mostly working on the server side while here it works all on the client side.
I could go on for more details, but you starts to see that basically any past project (being a success or not) actually does increase your knowledge and your pool of usable snippets / ideas. You may then think that my latest project is just a copy / paste project with old code lying around. Or a Frankenstein project with pieces coming from overall. Actually no, all the code or nearly is rewritten. Why? Because I changed tech, I want some improvements, I can use some new design patterns and so on. Still the base ideas are mostly a re-use of what I did before, added a few new concepts and improved the areas which didn't work well before.
Have a similar or non-similar experience to share? Please do so and let us know how you work between your different projects!
- Map editor: clearly I took the knowledge I had in Nowhere Else and Beyond (NEaB) which was my first map editor at that time. The technology behind is not the same (was using the DOM and JS while now I use canvas and Typescript), even the backend is completely different (was PHP now it's Node.JS). Still many concept like automatic tile transitions, or road painting are from the NEaB.
- Scripting language: when I wrote wsirc, I had the need to be able to customize it for some of it's usage. For this I created a language nearly like JS and its parser to be able to run it within my tool without having any security issue (not like if you let anyone put custom JS on your page). I had to learn how to build a tokenizer, parser, and AST and then execute it. While I had previous experience with YACC ( https://en.wikipedia.org/wiki/Yacc ) I never went as far in the direction of creating a full language. The same knowledge has been then ported to Ludiculus and finally to my latest project.
- Canvas & sound: the first thing I really made with canvas and html5 sounds was Cubicverse. While the project was somehow working it clearly didn't reach any useful market. People didn't liked so much the idea nor the art. Also the code was all JS, not easy to maintain at the end, and after 1 and half year I stopped.
- Maze generation: taken again from NEaB, I had the need there to have random dungeons generated daily. For that I made some script which was generating them, and part of it was a maze generator. The code has been then ported to Cubiverse later to Ludiculus and finally latest implementation in the current project.
- Path finding: guess what, again from NEaB to Cubicverse and to Ludiculus. I basically implemented a A* path finding and use that for my AI.
- Chat: This is not all that far from a simple socket.io chat, but with the path knowledge of what is needed from NEaB. On NEaB I was doing AJAX polling (as there was no web sockets at that time).
- NPC dialogs, and questing: The concept comes from NEaB and the quest / NPC system I had. There it was mostly working on the server side while here it works all on the client side.
I could go on for more details, but you starts to see that basically any past project (being a success or not) actually does increase your knowledge and your pool of usable snippets / ideas. You may then think that my latest project is just a copy / paste project with old code lying around. Or a Frankenstein project with pieces coming from overall. Actually no, all the code or nearly is rewritten. Why? Because I changed tech, I want some improvements, I can use some new design patterns and so on. Still the base ideas are mostly a re-use of what I did before, added a few new concepts and improved the areas which didn't work well before.
Have a similar or non-similar experience to share? Please do so and let us know how you work between your different projects!