The Dink Network

SeconDink Life: tweak dink code to play on real world map?

June 29th 2015, 01:06 PM
duckdie.gif
I'm trying to tweak freedink's source code so that dink could play on
an actual map of the world (provided by Open Source Map or Google
Maps) with nearly infinite scaling, with scripts/sprites/maps provided
from a remote server, and was wondering if anyone would like to help
me.

A sample story might be that Dink starts on a highly-zoomed in map of
Fresno in his house and a visitor is telling him that there's a
princess trapped in the Tower of London.

Dink then enlarges himself ("eh-neeek-chock") by pressing lower case
'z' so he can walk to London easily.

Once he gets close to London, he can shrink himself back down
("minimus dinkimus") using capital Z, until he finds the Tower of
London and tries to rescue the princess, only to be told "our princess
is in another castle".

Dink could fight monsters in Tokyo...

Japanese Man 1: "RUN! IT'S GODZILLA!"
Japanese Man 2: "It looks like Godzilla, but it's actually a Bonca."
Japanese Man 1: "STILL! WE SHOULD RUN LIKE IT IS GODZILLA!"

Of course, this is a highly simplifed version. The water might be
"hard", so Dink may need to find a land route from Fresno to London,
for example.
June 29th 2015, 01:44 PM
peasantmp.gif
Skurn
Peasant He/Him Equatorial Guinea duck bloop
can't flim flam the glim glam 
Shouldn't the enlarge and shrink keys be switched?
June 29th 2015, 02:03 PM
duckdie.gif
Believe it or not, I actually thought about that. The 'Z' would "zoom in" on the map you are viewing, and the 'z' would "zoom out".

Of course, zooming in on a map makes the player smaller and vice versa.
June 30th 2015, 12:52 AM
duck.gif
Toof
Peasant He/Him
I disagree. 
Adding hardness would be a bitch though...
June 30th 2015, 10:37 AM
duckdie.gif
In theory, you could rewrite "hard.dat" (with an external program) for each screen load and then call load_hard()?

But it's true that you can't scriptmatically set screen hardness. You *can* scriptmatically set sprite hardness (I think), which might be a workaround.
June 30th 2015, 10:49 AM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
you can script tile hardness using map_hard_tile() and draw_hard_map() but that would be painfully annoying to do and probably a lot more time consuming that using hard sprites.
July 13th 2015, 10:38 AM
duckdie.gif
I've now tweaked dinkvar.c and freedink.c in the freedink source code
to pull data from a remote source, and written a trivial D-MOD to test
it. The results are at:

https://github.com/barrycarter/bcapps/tree/master/DINK/bctest
https://github.com/barrycarter/bcapps/blob/master/DINK/bc-make-screen.pl

but you unfortunately can't just download this and play it.

I made source code changes to "freedink-1.08.20090120" (the only
version that compiles for me), so you may need to make different
changes (I believe a lot of the functionality of freedink.c and
dinkvar.c has moved to other C files).

The main change I made is adding these lines to dinkvar.c:

< save_game(0);
< char cmd[200];
< sprintf(cmd,"/home/barrycarter/BCGIT/DINK/bc-make-screen.pl %d %s",num,path\
s_dmodfile(path));
< system(cmd);

[as the comments (which I don't quote above) point out, hardcoding my
home directory is not very portable]

bc-make-screen.pl is the external program that does most of the work
by reading the current state of the game (from save0.dat), creating a
single screen map.dat file, and writing story/DYNAMIC.c (which is
called per the created map.dat file).

Because the created map.dat file is only one screen, I changed:

> fseek(f, holdme, SEEK_SET);

to

< fseek(f, 0, SEEK_SET);

The changes I made to freedink.c are adding:

*pmap=34;

after every instance of:

draw_map_game();

This keeps Dink on the "same" screen, but the global variables &x, &y,
and &z (initialized in story/MAIN.C) keep track of where Dink "really"
is. This allows for an infinite number of screens.

Currently, the D-MOD just has Dink announcing his x, y, and z
coordinates as he walks around a perfectly barren world. You currently
can't change the &z coordinate, but i plan to bind the Z key for this
later.

I would appreciate thoughts, suggestions, etc.
July 13th 2015, 11:14 AM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
Nice! You could use some screen capture program to record while you're playing and upload it somewhere.
July 13th 2015, 11:43 AM
duckdie.gif
It's really lame at the moment. I'm hoping to add a little bit before using recordmydesktop to record and post it.