Author Topic: Source Code to Touhou Danmakufu (revive)  (Read 11780 times)

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Source Code to Touhou Danmakufu (revive)
« on: January 25, 2012, 03:59:25 AM »
nearly 2 years later...
I've talked to MKM, the guy who made the source code for danmakufu (or, at least the script engine for it).
It's surprisingly simple and powerful machine. It's written in C++ and the script engine consists of a virtual machine and a parser that takes the script as a text document and compiles it into bytecode for the machine to execute at runtime. The user-defined routines are stored in a pointer somewhere in the machine. The scripting language supports an abstract data type that, in c++, boils down to a union of primitive types.

I'm working on an improved version of game engine, it'll use the similar syntax to danmakufu. This guy knew what he was doing.


give me a private message if you're still interested in the source, I'll see if I can throw it out for you.
look here
« Last Edit: January 02, 2013, 06:34:46 AM by Fujiwara no Mokou »

Mеа

  • catnapping
  • three dots connect to rectangles
Re: Source Code to Touhou Danmakufu
« Reply #1 on: January 25, 2012, 06:19:26 AM »
I think you've gotten a really nice find, good job. I'm sure people will be interested in this.
Just out of curiosity, this is the v0.12 I'm assuming?
Naked expression; purple raspberry flavour

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Source Code to Touhou Danmakufu
« Reply #2 on: January 25, 2012, 07:09:36 AM »
I was about to ask what dumbass bumped a dead thread to ask for the source again, but then I read that
THE SOURCE IS HERE!?

Also amazing is the fact that you found a two year old thread instead of making your own, but I'll ignore that in light of this glorious news.

EDIT: If it ain't obvious from that, I'm interested in the code too. If MKM didn't say anything about not distributing the source, I'd like a copy please.
« Last Edit: January 25, 2012, 07:13:17 AM by Blargel »
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: Source Code to Touhou Danmakufu
« Reply #3 on: January 25, 2012, 07:50:10 AM »
The original topic starter is dead. I don't see how is able to PM you. Splitting this thread.

Edit:
I am curious though what can be made out of the source code in 0.12m and how that is going to be supreme/better than the newest danmakufu? The only thing that crosses my mind is perhaps some optimizations for people who spent a lot of time in the old engine and don't want to restart in the new one.


Momiji

  • Cya
Re: Source Code to Touhou Danmakufu (revive)
« Reply #4 on: January 25, 2012, 09:23:49 AM »
Linux support please.   :ohdear:

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Source Code to Touhou Danmakufu (revive)
« Reply #5 on: January 25, 2012, 09:11:17 PM »
The source code to danmakufu script engine. It is in C++.
I've taken the liberty of translating as much I can to english.

Note that this is just the engine. If you want to make a fully fledged shootemup from this, you must integrate the directx/opengl UI into the engine accordingly.
Get acquainted with the callback function format and make the script functions yourself (GetEnemyX/ SetVertexUV/XY/ CreateLaser01, etc)
ScriptEngine.hpp
ScriptEngine.cpp
Sample.cpp
script.txt

I have high hopes for this community. Good luck.
« Last Edit: January 25, 2012, 09:55:05 PM by Fujiwara no Mokou »

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Source Code to Touhou Danmakufu (revive)
« Reply #6 on: January 25, 2012, 11:11:15 PM »
I've talked to MKM, the guy who made the source code for danmakufu (or, at least the script engine for it).

Note that this is just the engine. If you want to make a fully fledged shootemup from this, you must integrate the directx/opengl UI into the engine accordingly.

That was a bit misleading at first. In my excitement I thought we had the whole danmakufu engine but if we only have the script engine, we can't really do anything. Not unless we write a working game engine (bullets, players, enemies, bosses, collision detection, etc) to couple it with anyway. I don't think anyone here has the time to do that unfortunately.
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Yukari-Chan

  • Excuse me while I prepare /your/ demise. <3 TSO
Re: Source Code to Touhou Danmakufu (revive)
« Reply #7 on: January 25, 2012, 11:27:26 PM »
Wait, this is a script engine? I thought we can open Touhou Danmakufu without problems. Then I can edit title and add bgm :'D. Oh well, guess this will do


Aw ignore my first post, we have a source code and that's all that matters xD
« Last Edit: January 26, 2012, 01:02:17 AM by Yukari-Chan »
" Borders are Borders. They were meant to be manipulated and mistreated. "

Fujiwara no Mokou

  • Hourai Incarnate
  • Oh, so this trial of guts is for ME?
    • Profile
Re: Source Code to Touhou Danmakufu (revive)
« Reply #8 on: August 26, 2012, 05:58:14 AM »
Woo, I'm back. It's been a while since I've been here.
I've done a lot of research while I was away. The complete source code to Danmakufu is still in the shadow, and I think it'llalways stay that way, but I found something that may interest some devs.
Danmakufu's scripts take an already existing concepts of coroutines. Most notably, the tasks that run in parallel in each script entities, and even the entities themselves.
Danmakufu's ScriptEngine uses a FSM to get the job done by emulating threads. The tasks explicitly yield to the other threads. Well, in this case, it's better to call them something like fibers, because tasks yield themselves in the script rather than have a scheduler to yield them for you.
Danmakufu's implementation of it (at least, compared to hardcoded C OS-specific fibers) are actually quite heavy. Unfortunately C/C++ programming languages are sequential languages that assume the program runs on only one thread and thus is designed as such, but operating systems take advantage of ASM to save/restore the call stack and CPU registers to implement it anyway. In fact, there's a whole article about it I came across for Windows here. Anyway, I think these will be my last words on the subject, seeing as I went a bit off-topic. But hopefully this will help other devs with whatever game it is they're making. I know how irritating task-scheduling for entities to run parallel processes can be, and this has definitely become a popular paradigm for AI programming in games.
« Last Edit: August 26, 2012, 06:04:31 AM by Fujiwara no Mokou »

Kaze_Senshi

  • Ehhhhh...
  • Pale Apple
    • My youtube channel
Re: Source Code to Touhou Danmakufu (revive)
« Reply #9 on: August 28, 2012, 10:00:44 PM »
Hmmmm so will the Danmakufuu code become "open-source"? I was thinking if there is a way to create a Danmakufuu version playable via browser, using html5 or something like to create the images.
My youtube channel with my creations: https://www.youtube.com/user/KazeSenshi2929
( ゆっくりしていってね)>