Thanks! I noticed I've actually mucked up the node-naming on there. I should probably have:
Add nodes "A1", "A2", "A3" one after another.
Add a node after "A3" - "A4".
Add another node after "A3" - "A3A1".
Add another node after "A3" - "A3B1".
Add a node after "A3A1" - "A3A2".
Add another node after "A3A1" - "A3A1A1".
and so on...
. Mind you it's just "hard-scripted" at the moment.
I've fixed a problem with the change in speed that I think was in that video as well.
Other news: I'm looking into the inner workings of script saving for when I start working on the editor. Got on my nerves for the most part but it works now. The biggest irritation was that extra line that was invariably added to the bottom of every outputted script, but that's gone now so yay.
If anyone wants an example, start with this and call it nodes.lua:
function init()
end
function add_node(x, y)
DBPro.Call("Dot", x, y)
end
. Have this DBPro code:
sync on
sync rate 0
// prepare lua, and redraw the saved nodes to the screen.
lua make 1
lua load file "nodes.lua"
lua push function "init"
Null = lua call function(0, 0)
// set the file name.
f$ = "nodes.lua"
do
// update mouse.
omc = mc
mc = mouseclick()
mx = mousex()
my = mousey()
if mc = 1
if omc = 0
// add new dot to screen.
dot mx, my
// open the existing file and create a new blank one.
open datafile to read 1, f$
open datafile to write 2, "copy - " + f$
n = 1
// copy the existing file's contents to the new file, adding the extra node.
while datafile end(1) = 0
temp$ = datafile string$(1)
write datafile string 2, temp$
if n = 1 then write datafile string 2, "add_node(" + str$(mx) + ", " + str$(my) + ")"
inc n
endwhile
// close the two files.
close datafile 2
close datafile 1
// reopen the two files in reverse, creating a new blank file in place of the original one.
open datafile to read 1, "copy - " + f$
open datafile to write 2, f$
temp = datafile size(1)
if temp > 2
// copy everything from the copy file to the new file, except the extra bytes 13 and 10 (the final line).
for n = 1 to temp - 2
b = datafile byte(1)
write datafile byte 2, b
next n
endif
// close the two files, and delete the copy.
close datafile 2
close datafile 1
delete file "copy - " + f$
endif
endif
sync
loop
and run it. Click to draw a dot to the screen, and it'll automatically add it to the script (albeit rudimentarily; it slots it in at a fixed line). Next time the program starts, it'll call the script (looking something like this:
function init()
add_node(920, 534)
add_node(901, 523)
add_node(881, 524)
add_node(855, 522)
add_node(827, 527)
add_node(803, 534)
add_node(798, 542)
add_node(788, 542)
add_node(771, 553)
add_node(756, 576)
add_node(752, 593)
add_node(752, 608)
add_node(752, 601)
add_node(752, 580)
add_node(760, 564)
add_node(778, 546)
add_node(796, 538)
add_node(794, 546)
add_node(813, 530)
add_node(840, 523)
add_node(869, 520)
add_node(892, 523)
add_node(909, 527)
add_node(629, 509)
add_node(639, 528)
add_node(642, 546)
add_node(650, 553)
add_node(664, 569)
add_node(675, 578)
add_node(690, 594)
add_node(705, 605)
add_node(728, 612)
add_node(741, 613)
add_node(768, 617)
add_node(785, 618)
add_node(817, 620)
add_node(852, 613)
add_node(863, 610)
add_node(898, 600)
add_node(917, 585)
add_node(923, 566)
add_node(930, 538)
add_node(935, 522)
add_node(924, 549)
add_node(909, 591)
add_node(879, 607)
add_node(836, 617)
add_node(800, 619)
add_node(752, 614)
add_node(716, 606)
add_node(684, 587)
add_node(655, 561)
add_node(640, 535)
add_node(633, 514)
add_node(630, 498)
add_node(732, 495)
add_node(742, 495)
add_node(774, 495)
add_node(799, 495)
add_node(892, 504)
add_node(930, 507)
add_node(916, 505)
add_node(902, 504)
add_node(882, 503)
add_node(870, 500)
add_node(855, 500)
add_node(849, 500)
add_node(831, 499)
add_node(820, 498)
add_node(808, 496)
add_node(787, 495)
add_node(761, 494)
add_node(752, 494)
add_node(722, 493)
add_node(706, 492)
add_node(694, 487)
add_node(674, 487)
add_node(664, 486)
add_node(643, 484)
add_node(632, 484)
add_node(925, 421)
add_node(919, 421)
add_node(908, 419)
add_node(900, 413)
add_node(892, 406)
add_node(887, 398)
add_node(885, 385)
add_node(886, 382)
add_node(885, 375)
add_node(814, 451)
add_node(832, 456)
add_node(857, 460)
add_node(876, 463)
add_node(901, 462)
add_node(916, 462)
add_node(925, 466)
add_node(908, 463)
add_node(884, 462)
add_node(864, 462)
add_node(840, 457)
add_node(820, 452)
add_node(927, 463)
add_node(928, 441)
add_node(925, 412)
add_node(915, 394)
add_node(898, 373)
add_node(872, 372)
add_node(852, 384)
add_node(833, 389)
add_node(820, 403)
add_node(811, 413)
add_node(808, 431)
add_node(804, 449)
add_node(725, 397)
add_node(725, 409)
add_node(736, 419)
add_node(750, 426)
add_node(760, 426)
add_node(744, 426)
add_node(729, 414)
add_node(723, 401)
add_node(731, 385)
add_node(652, 402)
add_node(660, 388)
add_node(676, 381)
add_node(692, 379)
add_node(718, 386)
add_node(734, 372)
add_node(749, 384)
add_node(765, 404)
add_node(772, 425)
add_node(773, 438)
add_node(772, 454)
add_node(748, 453)
add_node(726, 450)
add_node(708, 450)
add_node(701, 450)
add_node(688, 448)
add_node(672, 447)
add_node(646, 445)
add_node(743, 367)
add_node(709, 384)
add_node(724, 378)
add_node(769, 416)
add_node(757, 394)
add_node(728, 380)
add_node(702, 379)
add_node(664, 384)
add_node(643, 412)
add_node(634, 430)
add_node(737, 451)
add_node(683, 448)
add_node(762, 450)
add_node(717, 450)
add_node(659, 445)
add_node(631, 444)
add_node(366, 120)
add_node(371, 113)
add_node(388, 106)
add_node(396, 104)
add_node(409, 104)
add_node(423, 109)
add_node(432, 117)
add_node(444, 139)
add_node(341, 178)
add_node(329, 173)
add_node(310, 168)
add_node(295, 163)
add_node(282, 161)
add_node(275, 159)
add_node(268, 166)
add_node(264, 174)
add_node(448, 223)
add_node(437, 253)
add_node(420, 282)
add_node(393, 306)
add_node(360, 313)
add_node(325, 312)
add_node(299, 302)
add_node(280, 285)
add_node(273, 268)
add_node(404, 168)
add_node(412, 175)
add_node(423, 194)
add_node(412, 208)
add_node(398, 208)
add_node(388, 195)
add_node(389, 178)
add_node(394, 173)
add_node(313, 176)
add_node(323, 182)
add_node(328, 194)
add_node(322, 208)
add_node(308, 210)
add_node(297, 200)
add_node(296, 189)
add_node(300, 174)
add_node(468, 383)
add_node(467, 405)
add_node(452, 404)
add_node(452, 387)
add_node(594, 377)
add_node(596, 330)
add_node(366, 415)
end
function add_node(x, y)
DBPro.Call("Dot", x, y)
end
) and redraw your "saved" dots for you to add to.
How this will work in the editor I'm not entirely sure. I suppose the best bet is to start every AO off with a default script for it's class, that contains key comments in places for data to be entered. Then whenever it needs to be saved, it just looks through until it finds something like "-- FOOD" and it writes "FOOD = {pie; apple; brick};" or some'etes.
edit/update Been a bit concerned over where this game could potentially be going in terms of it's size. So I did a little bit of thinking and here it is:
TEST 1:
Values from guesses based on the size of similar files. Guessing there
will be about 6 levels. If not, then simply scale up/down the results.
IMAGES: 50kb x 200tiles x 6levels = 60000kb
SOUND: 350kb x 30sounds = 10500kb
MUSIC: 52500kb x 2versions x 6levels = 630000kb
TOTAL: 60000kb + 10500kb + 630000kb = 700500kb = 684mb = 0.668gb
TEST 2:
Took the mean of 33 tiles' sizes to give 35kb a tile. Converted a 443kb
wav into a 31.4kb mp3, making it ~0.071 times the size. Applying this to
music, each piece would be 52500kb x ~0.071, or 3720kb.
IMAGES: 35kb x 200tiles x 6levels = 42000kb
SOUND: 350kb x 30sounds = 10500kb
MUSIC: 3720kb x 2versions x 6levels = 44640kb
TOTAL: 42000kb + 10500kb + 44640kb = 97140kb = 95mb = 0.093gb
TEST 3:
Taking into account AO image needs. If we were to look at all possible
AO images, likely there would be a lot of smaller images and fewer larger
images. The likelihood that any one image would exceed the full size of
a tile is unlikely. So guessing at about 25kb an image. Regarding the
number of frames of animation per AO, again the number for each will
vary from just 1 up to something like 30 for the player or 10-15 for
common enemies. Therefore, guessing at about 8 overall. Finally, guessing
at about 20 AOs per level, and remembering levels may share AOs.
AO IMAGES: 25kb x 8frames x 20AOs x 6levels = 24000kb
TOTAL: 97140kb + 24000kb = 121140kb = 118mb = 0.116gb.
TEST 4:
Finally, taking into account scripts. Assuming ~80 AO Classes, and
around 100 pre-loaded AOs per level. Also taking into account program
scripts, of which there is just one main script and one per level. Each
script is estimated to be on average about 2.5kb per AOC, 1kb per AO, and
15kb per program script.
AOC SCRIPTS: 2.5kb x 100 = 250kb
AO SCRIPTS: 1kb x 100 x 6 = 600kb
PROG SCRIPTS: 15kb x 7 = 105kb
TOTAL: 121140kb + 250kb + 600kb + 105kb = 122095kb = 119.23mb = 0.116gb.
TEST 5:
Rounding up to 125mb for fun (also remembering the program itself, about 3-4 mb).
TOTAL: 125mb = 0.122gb.
DOWNLOAD TEST:
It takes 90 seconds to download a 3.5mb file (from tgc; may be rather quick/slow).
It would take around 35.714 times longer to download 125mb.
Therefore it would take around 3214 seconds, or 53minutes.
However, .ZIP compression can shrink 2.53mb of files to 1.59mb, x0.628 size.
Now although this doesn't apply consistently to all types, sizes and combinations
of files, lets just pretend that in general it does.
Then 125mb x 0.628 = 78.56mb.
Download time = 3214 seconds * 0.628 = 2018 seconds.
2018 seconds = 33.64 minutes.
Which is about half an hour.
Which is about the time it takes to go from starting a cup of tea to finishing it.
If you don't rush.
SO TO RECAP:
6 Levels of game at 78.56mb taking half an hour to download on an average connection
and requiring 125mb - about 1/10th of a gigabyte - to sit on the computer, which is
about 0.000305 of a HDD of about 400gb.
(According to Nex TFFF, 110mb for a content-rich game "really isn't bad" (TGC Heroes
WIP, bottom of page 16). So... well I guess I'm doing alright.)
Now of course a lot of that is "educated" guesses and what I assume to be pretty fuzzy assumptions.
Also big quantities will probably roll some eyes. Nevertheless...
Anyway, the key thing to watch here is clearly the size of the music. Up to now I'd been planning to use .wav for music, as it loops pretty much perfectly (in comparison to .mp3s of the same sounds, which loop horribly). Now I think I'm going to revisit
Torrey's Enhanced Audio Plugin so I can use .mp3s, get them to loop, and take even better control of them. regarding the mention somewhere above of "2 versions" for each music, I am of course referring to my being inspired by Mario Galaxy. Damn I only got to play it once for about half-an-hour, an absolute tease. Anyway, examples of my hopes for use of music:
Buoy Base above water, and
below. Or,
Bowser battle and
chorus. Awesome stuff.
further edit Come to think of it, my music file-size guesses were based on the idea of the music being about 150 seconds. In practice they're likely to be about 2 thirds of that, which leans the overall size much closer to that 110mb-uncompressed target. On the other hand, that freed up space would probably be occupied by additional title/boss music, so...
Extra stuff - File size is all well and good but how would the game perform with a level loaded and playing? Well I did
a rough test by loading about 4-5 times as many 256x256 images as I would need in any one level. 2768 images, 692mb in memory (I think? roughly ((256*256*(32/8)) * 2768)bytes/1048576?). Runs at a consistent frame rate of 58-60fps (whether or not it would ever affect it in the slightest I'm not sure, but best to check anyway). Actually crashes on 2768 for me but I don't think I should be the least bit concerned by that.