Page 1 of 2

zip support

Posted: Thu Dec 01, 2005 8:14 pm
by HerzAusGold
After find and building up a zip/unzip library, I'm now able to integrate it to rnd but how should it work? Only unziping seems pointless, the user can do this. Please post any ideas or suggestions here.

Btw. please test the two levels in rndTest (uploaded to zomis-rnd)

Posted: Fri Dec 02, 2005 9:59 am
by Zomis
I do know that Alan will include zip-support in his ConfEdit (I think it was...). It will be like compressing some levelsets so they won't be loaded each time RND starts...

And if you want to implement zip-support in RND, why haven't you already thought about how it should work...?

Posted: Fri Dec 02, 2005 7:04 pm
by Holger
It would be cool if R'n'D could read level directories from zip files.

That way new sets could be "installed" by just dropping the archive into the "levels" directory. :-)

Something that's on my TODO list for a very long time...

Posted: Sat Dec 03, 2005 12:24 am
by Alan
It would be cool if R'n'D could read level directories from zip files.
You don't need to read directorys inside a zip. All you do is have each game as a single zip file which is unzipped before playing. After you have finished playing, delete the game folder.....

That's what I'm doing ;-)

prepare

Posted: Wed Dec 07, 2005 11:38 pm
by HerzAusGold
Hi,
for the first step I implement like Alan suggested.
It's ready soon, may be next weekend. Only some testing is to do.
Prepare your folders: make a subdir "levzips", "levtmps" like the "levels"
directory.
Transparent using of zips would be appreciated, like in "winuae".
May be on some day, you can insert ".adf"-Files.
But there are so many places to change....

Posted: Sat Dec 10, 2005 11:22 pm
by Holger
> Transparent using of zips would be appreciated, like in "winuae".
> May be on some day, you can insert ".adf"-Files.

This would both be possible by adding an abstraction layer for file access; you could then read files (levels, artwork etc.) directly from ZIP or ADF files.

This would be a nice side project for R'n'D, which could then be integrated into the main project! :-)

Zip-Support is ready

Posted: Sun Dec 11, 2005 8:45 pm
by HerzAusGold
rndTest with zip support (and more) is ready.
download here: http://www.zomis.net/rnd/info.php?f=391

following options are available:
-gameatwork
Special mode for starting and leaving game immediately

-sokomode=
0 is sokomode off
1 is sokomode with key simulation test 1 (recorded)
2 is sokomode with key simulation test 2 (recorded)
3 is sokomode with direct move (stable but not recorded)

-user=
define user name

-home=
define home directory
normaly at HOME-Dir (homemode is off)
with no arg, at SUB-Dir 'home'
with arg include no path, at SUB-Dir '<arg>'
with arg include path, at this location

-levtmps=
levtmps directory

-levzips
levzips directory

-zipfile=
search in dir 'levzips' for zip file with wildcard

-zipmask=
extract only this from zip (with wildcard)
needed levelinfo.conf is extracted too

--> So you have only to install the game itself and put the contributions (and the other levelsets) into the 'levzips' folder.
--> You do not need to extract all, only a specific 'levelset' or a specific 'author'
So it remains clear. You (can) have only one additional menu entry.
--> Up to now, no deletion is done in the 'levtmps' folder.
But you can do it in a batch file.



Usage example:
> rndtest -zipfile=contri -zipmask=rnd_abby_king/
Extract only rnd_abby_king levels from a zip file containing 'contri'

> rndtest -zipfile=snake_bite
Extract the whole snake_bite levelset

> rndtest -zipfile=snake_bite -zipmask=snake_bite_jue/
Extract only the snake_bite_jue levels.
Hard to play if you have no normal snake_bite extracted :-)

Btw: play my levels, you cant reach level three (may be)
this approach lead the player to a newer game
with a request (like martijn suggested).
--> It's warp the player to an other levelset.

Btw: why are the abby king levels so quick (controlling the
player is terriblly)
It seems it designed for an older rnd version
The same for many levels, and other levelsets...
Is it possible to improve this? (Or adjust this)
--> This is may be one reason, why the game sucks..

Hi, Holger what do you think about 'sokoban mode'?
and may be you can help because sometimes the players run
dont end (if this happen click a wall, or try to move with the keys)
How can I improve this?

yeah, an abstract layer is necessary, but so many places to change,
may be you can prepare this a little by passing a struct to all relevant routines (including filename, zipname)

Btw: sorry about my english.

Posted: Wed Dec 14, 2005 10:26 pm
by Flumminator
I can only agree. Clearer (or at least clearer documented) interfaces would ease programming in the R'n'D code greatly.

Unluckily Holger seems to be the only one who could possibly do such a restructuring. This would be a nice thing to have in R'n'D 4.0.0 (or 5.0.0 or 6.0.0 ;) )

Posted: Fri Dec 16, 2005 6:53 pm
by HerzAusGold
Flumminator wrote:I can only agree. Clearer (or at least clearer documented) interfaces would ease programming in the R'n'D code greatly.

Unluckily Holger seems to be the only one who could possibly do such a restructuring. This would be a nice thing to have in R'n'D 4.0.0 (or 5.0.0 or 6.0.0 ;) )
And so many global variables (I know game writing without is difficult).
But for version 7.0.0 try to seperate the game from the other stuff. ;)
Ok, for example the extern vars, if use the "extern C" directive you can put it into an other header file. (But I think, you know this...)
(May be use classes for some stuff).
Don't panic. Merry Christmas.

Posted: Fri Dec 16, 2005 9:05 pm
by Holger
> And so many global variables (I know game writing without is difficult).

Yes, it looks a bit nasty... :-/

But as you said, it isn't really possible without.

> But for version 7.0.0 try to seperate the game from the other stuff.

The game engine already is separated in "game.c" (and in "game_*/").

All generic, interface and platform dependent stuff (which could also be used for other games) is in "src/libgame".

But if you have any suggestions, feel free to tell here. I'm just at cleaning up the code a bit anyway...

> Ok, for example the extern vars, if use the "extern C" directive you can
> put it into an other header file. (But I think, you know this...)
> (May be use classes for some stuff).

Did I miss anything? The game is in C, not in C++, you know. (And I must admit that I still use C89 and not C99. I think I will finally switch to the latter soon...)

> Don't panic. Merry Christmas.

Same to you! :-D

Do you have no time?

Posted: Mon Dec 19, 2005 11:48 am
by HerzAusGold
Hi,
I am surprised to get a response for this post.
But what about my zip support?
- It seems nobody want it.
And the questions here?
- Nobody takes note of it

And the sokoban mode? As I mentioned sometimes the player run dont stop. Ok, its my stuff. But I am not (enough) familiar with your game code and your frame switching.
- Nobody want to help?

It seems changing the source is not allowed.
- May be, I make something you never request. What do you think?

The best way to get a reply is to post things like asiekierka:
Hey, there is my birthday...
Then I try: Hey christmas is coming, please answer to my questions.

Are you a closed association?
- Do'nt take that too seriously.

I join the forum at 4 months ago, because I'm a great fan of BD,EM.
want to improve some things...

What's up. Say it.
Thank you for any reply.

Posted: Mon Dec 19, 2005 12:48 pm
by Darkon
Im not even 100% sure what you just said, but it seems your annoyed that noone else is replying to this thread?

Keep in mind the RnD community isnt exactally HUGE, there are alot of members but your lucky to have even 4 on in a week.

And by the fact that I know nothing about programming I dont check the programming section (apart from just now of course), this could be the case for many people.

Posted: Mon Dec 19, 2005 4:19 pm
by Alan
The best way to get a reply is to post things like asiekierka:
That's the absolutely wrong way to get attention imo.

If you're looking to merge your code with the main source then only Holger can answer your questions, and he already has?

Programmer's Corner is always empty...... I've posted a few things here with no reply, that's just the way it goes I'm afraid. Most people come to the forum discuss playing/editing Rnd and the few people that mod it are probably busy (being xmas and all!).

Anyway, you have 12 replies in here.....from both moderators and Holger..... I'd say that's a good response!

Posted: Mon Dec 19, 2005 10:11 pm
by Holger
Hello HerzAusGold,

maybe I have to apologize for not responding fast and detailed enough. The problem is that I do not earn any money with R'n'D (and don't want to), therefore I have to do some Real Work in the Real World. :-( ;-)

This, combined with upcoming christmas, currently causes a huge lack of free time I could elsewhere spend on R'n'D (programming, writing forum posts, evaluating contributed levels, evaluating program patches etc.). As a direct effect of this shortage on time, several people are currently more or less annoyed or angry with me, and I really have a bad conscience about it! :-( Unfortunately, as the day has only 24 hours, I can't do much about it than asking for a bit more patience. :-(

So please don't hurry me. I try hard to answer in time, look at things that were sent to me or do other things to make people happy. ;-)

Now to your questions:

> Hi, Holger what do you think about 'sokoban mode'?

Unfortunately, I wasn't able to have a look at it due to nearly no free time. :-(

As far as I can tell from your posts and mails, it doesn't fit 100% into R'n'D as it requires the use of the mouse while playing, but I may be wrong here. Besides that, it's probably no problem for the Sokoban mode. I have to see for myself.

> and may be you can help because sometimes the players run
> dont end (if this happen click a wall, or try to move with the keys)
> How can I improve this?

I don't know, as I haven't seen the source/patch yet. I have to look at foreign source code at work too, and sometimes it's hard work and sometimes not funny. Maybe your patch is nice and small, so maybe it's not much work to use it, play around with it, understand it, and even a lot of fun. In any case, it will cost some time. I will definitely try it as soon as I have more free time.

> yeah, an abstract layer is necessary, but so many places to change,
> may be you can prepare this a little by passing a struct to all relevant
> routines (including filename, zipname)

Why not just wrapping away all file accesses? There are libraries out there for transparent zip support that do just that.

Believe me that this is possible even without recompiling! You can hook your own library calls into the file I/O layer without even touching the executable! So you don't really need the things you described...

> And the sokoban mode? As I mentioned sometimes the player run dont
> stop. Ok, its my stuff. But I am not (enough) familiar with your game code
> and your frame switching.
> - Nobody want to help?

If somebody would look at my and your code, he/she could help. This is quite a time-consuming task, you know.

Improving the Sokoban mode is currently not very high on my TODO list, so I can't promise to spend a lot of time on this very soon.

> It seems changing the source is not allowed.

So you think I released the source code, under the GPL (show me a more liberal license), because I do not want anybody to change the code? You must be kidding here... ;-)

> - May be, I make something you never request. What do you think?

Do you really want to know what I think? I think "Fine that you're able to implement things you would like to have in R'n'D it by yourself"! :-)

Because many people request features I don't have time for, even if I like these potential features.

Besides that, why should I request something? You can just change the source code as you like, and don't have to ask me first.

And if anybody should implement things I would really like to have in R'n'D, but cannot find time for it, I'm happy to add it to R'n'D! Here are some of these tasks:

- Add a 100% compatible Supaplex engine to R'n'D.
- Add a 100% compatible Boulder Dash engine to R'n'D.
- Add both engines as seamless as possible into the main engine.

> Are you a closed association?

No, we aren't. Honestly! It's just that those people who could contribute most to R'n'D here seem to have the least free time doing it. And those who do have a lot of free time... Well, see for yourself. ;-)

> I join the forum at 4 months ago, because I'm a great fan of BD,EM.

Then you're in very good company here! Seriously! :-)

> want to improve some things...

And you're more than welcome then, believe me! :-)

One last thing: If all else fails (I mean: nobody has no free time at all to incorporate great patches, improvements, new features or other changes), you're always free to start a new branch of R'n'D for yourself -- that's the great thing of the GPL, which gives you exactly this right (you even don't have to ask the original author before!). This, for example, is what DiPal did with RoNDI (a great R'n'D port for mobile devices like Palm Pilot and PocketPC). So you have all the freedom Open Source / Free Software can offer these days! :-)

But I will look at your patch anyway (at least the Sokoban thing)... :-)

what an answer

Posted: Tue Dec 20, 2005 8:39 pm
by Guest
Wooo. What an answer-Now I am sure this is the right forum for me.
Sorry about my pertinacity - I wait patiently for your tests.
And does not try the RnD related things to lose sight of.

An other thing: For the sokoban mode I have to edit some conf_ Files.
Now I want to make an Visual C workspace. But Microsoft dont allow
C-Files which are not compilable for its own (I see this the first time and wondering a little - but not for a very long time)

So,where are your scripts or/and the data you get this files from??

Can you release this or at least explain please.
If you have no time now- no matter - I start this anyway - to see if this is possible and what is to do.
Because I think may be this can increase the member count.

Btw: Some here is from Babelfish (sorry about my english).