[Search] [FAQ] [Register] [Login] [Usergroups] [Members] [Rules]
[Terra Arcanum] [Forums] [Gallery] [Downloads] [Troikapedia] [Arcanum Wikia] [Troika Games]
 
Support Terra
Arcanum:
Good Old Games
 
 


Post new topic Reply to topic  [ 22 posts ] 
Author Message
 PostPosted: Sat Oct 08, 2011 10:26 pm Post subject:  putting the coast together
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
There are several tilesets making up the coast area:

Code:
{8}{sw1/n 0} Shallow Water 1
{9}{sw2/s/n 4} /s Shallow Water 2
{10}{sw3/s/n 4} /s Shallow Water 3
{11}{swr/s/n 4} /s Shallow Water
{12}{dwr/f/n 4} /f Deep Water

(also drtsw)


But how to put it all together (i.e. in what order) to make up a coast area?

Could you show me a sample 2d array of tiles that make up a coast without any jagged edges please?

-sh

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Sun Oct 09, 2011 9:35 pm Post subject: 
 
Water Merchant
User avatar

Joined: May 22, 2008
Posts: 585
Location: Czech Republic
Honestly, I don't have a clue, but you can try to ask Radzh, since he's the one who made his own version of WorldEd for the Arcanum: Revolution project, so I guess that he has it figured out already.

Also, AFAIR, this topic was also discussed at ArcanumClub.ru community, so try to search there.

Here's a link: http://forums.arcanumclub.ru/index.php?showforum=152

P.S. Btw, they are already aware of your project, so getting some help there shouldn't be hard. Link: http://forums.arcanumclub.ru/index.php? ... 30&p=91027

_________________
Image
#ArcanumAlive website | #ArcanumAlive at Facebook | #OpenArcanum development | #My blog | #New wannabe modding community


Top
 Profile  
 PostPosted: Mon Oct 10, 2011 1:49 pm Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
I'm gonna try some on my own. How does it look like now?

http://img338.imageshack.us/img338/3498/unledmp.png

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Mon Oct 10, 2011 2:11 pm Post subject: 
 
Water Merchant
User avatar

Joined: May 22, 2008
Posts: 585
Location: Czech Republic
Looks like a good start, but do you have a bigger chunk to show?;)

_________________
Image
#ArcanumAlive website | #ArcanumAlive at Facebook | #OpenArcanum development | #My blog | #New wannabe modding community


Top
 Profile  
 PostPosted: Mon Oct 10, 2011 2:48 pm Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
I'll have a bigger chunk when I code it to a game. Which I hope to accomplish today :)

Plan to do the same for all directions, i.e. rotate it either horizontally, vertically, or both. Consider this code:

Code:
                                Tuple<string> elt = RandomElt(SideDiagonal, r);
                                art = elt.Item1;
                                flip = elt.Item2 ^ (directions.Contains(Direction.SouthWest) ? Flip.Horizontally : Flip.Vertically);


Providing that a tile is mirrorable on both tiles (corners aren't, "sides" are), this code will work except for minor mistakes such as rocks being visible upside down or horizontally. With which I can do nothing, as there are no NW and N versions of the tiles.

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Mon Oct 10, 2011 3:09 pm Post subject: 
 
Water Merchant
User avatar

Joined: May 22, 2008
Posts: 585
Location: Czech Republic
foobie42 wrote:
With which I can do nothing, as there are no NW and N versions of the tiles.


Actually, many of the tiles are flippable, and the original engine knows which tiles are flippable and which not, so it doesn't need the flipped version, since it can be flipped easily on the fly, when rendering.

In the tile message file ("art/tile/tilename.mes"), there are specified ranges, which determines which tile is outdoor/indoor and non-/flippable, so you should use this info when generating new terrain.

There is also "tilevariant.dat" file, and I think that it contains the info about the transitions and other stuff, but it's a binary file.

_________________
Image
#ArcanumAlive website | #ArcanumAlive at Facebook | #OpenArcanum development | #My blog | #New wannabe modding community


Top
 Profile  
 PostPosted: Tue Oct 11, 2011 9:18 am Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
I made some progress.

http://img1.uploadscreenshot.com/images ... 8-orig.jpg

http://img1.uploadscreenshot.com/images ... 9-orig.jpg

There are some artifacts (not shown), especially at "corners" of the island. Still, I'm quite happy with it.

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Thu Mar 08, 2012 4:45 am Post subject: 
 
Water Merchant
User avatar

Joined: May 22, 2008
Posts: 585
Location: Czech Republic
Hello,

How are you doing? Still working on your project?:)

_________________
Image
#ArcanumAlive website | #ArcanumAlive at Facebook | #OpenArcanum development | #My blog | #New wannabe modding community


Top
 Profile  
 PostPosted: Sun Mar 25, 2012 2:37 am Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
After a long hiatus, yes.

I found another guy who's interested in a single-player RPG that's like the golden age's nineties ones.

Just rewrote the code in F#, just over 350 lines to parse Arcanum graphics and cache them efficiently.

I'm using MonoGame now which is like XNA.

Sorry to hear about your dog. How are you doing?

I'll use Arcanum textures as placeholders until proper graphics are made. The dude I know did art back in 2004 and can make some sprites.

If you're interested in the code I can put the repo somewhere public.

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Sun Mar 25, 2012 6:08 pm Post subject: 
 
Water Merchant
User avatar

Joined: May 22, 2008
Posts: 585
Location: Czech Republic
Oh hey, thanks for the reply!

That's pretty awesome news, I'm glad that you didn't gave up. Hmm, so you're using F# for the whole game? MonoGame seems like a wise choice, much wiser than using XNA, which is already obsolete.

It would be really great to get access to the repository, but it can wait, until you manage to clone the previous version completely.

I wish you good luck, and please keep up the good work and keep us updated.

P.S. I'm better now, it's been 2 months since my dog passed away. Still miss her a lot though... Thanks for asking.

_________________
Image
#ArcanumAlive website | #ArcanumAlive at Facebook | #OpenArcanum development | #My blog | #New wannabe modding community


Top
 Profile  
 PostPosted: Sun Mar 25, 2012 6:30 pm Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
http://arma.misaki.pl/listing.php?repname=divided - websvn
http://arma.misaki.pl/svn/divided/ - clone url

Sorry about SVN, but TortoiseGit is a piece of garbage.

So far I (re)wrote:

- the DAT loader
- the animation loader
- the cache circular-buffer structure, now optimized to be just one int on the heap (+ object overhead, aka runtime type information)
- hacked monogame not to cons (allocate on the heap) in the rendering loop, see http://monogame.codeplex.com/workitem/6844
- transparency mask bit array for clicking on sprites
- beginnings of the map editor

I have big plans for the map editor, actually.I missed the ability to hover the mouse with a selected texture to actually display it. Old 'favorites' menu will appear after it's written. As well as common operations such as undo, showing the grid etc.

As for the game, I have plans for a scripting language that allows serialization of everything, including closures and functions compiled at runtime. This comes with a performance cost, but who cares. I need that for my game AI. Also will come with coroutines for easy, declarative writing of NPC routines.

I also plan to finish my game GUI. Check out foobie42's channel on youtube to know what I mean. If you ever used a spreadsheet, that's the idea - dependent 'cells' refreshing when one of their referenced cells changes its value. It's not something I made up, but it was successfully used in several Common Lisp projects. Now I made it with nice syntax in F#.

As for the GUI, it doesn't have any controls aside from a vbox/hbox (logical layout, no per-pixel stuff like Windows Forms) and a button. However, mouse input is properly routed. I don't remember how's keyboard input however, and it's missing all basic controls, doesn't even have an input box which is painful, but will be done after the game is in a more advanced stage of development.

It will of course be ISC-licensed as all of my code.

Also I plan to have an asynchronous art asset loader. It's much more heavy-handed now, caching all frame in all direcitons at once to avoid per-frame delay e.g. for running animations which was quite visible.

I'm glad you're feeling better :)

Got any IM?

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Mon Mar 26, 2012 2:07 am Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
Today I implemented beginnings of the map editor.

- Stuffing Arcanum .art files into a WritableBitmap in WPF
- Refreshing the preview window
- Palette selector
- The overall layout of the editor

Forgot to add the palette number (2 * 3 bits) to the Tile class. So I will unify the Passability enum and palette numbers into one uint16. Fits just right. :)

Also, now decided that the editor will edit 3 cells at a time, so that 'connections' between cells can be easily made. It'll probably work on a 'database' (just a directory full of XML files though!) instead of arbitrary files.

Hope this gets somewhere.

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Tue Mar 27, 2012 8:41 pm Post subject: 
 
Water Merchant
User avatar

Joined: May 22, 2008
Posts: 585
Location: Czech Republic
I just checked the source, and I'm quite impressed. The F# is pretty new to me (what a funny syntax!), though I was able to understand the code.

Could you please sometimes upload to the repository a compiled version as well? I've noticed that you've uploaded the binaries in earlier revisions, but it's missing in the newer ones.

Btw, do you have any TODO list, or some dedicated webpage, like the one from your previous project?


foobie42 wrote:
As for the game, I have plans for a scripting language that allows serialization of everything, including closures and functions compiled at runtime. This comes with a performance cost, but who cares. I need that for my game AI. Also will come with coroutines for easy, declarative writing of NPC routines.

That's pretty awesome! Buy why don't you just stick with good old Lua, or javascript? You can bind your de/serialization routines to the scripting language, right?

foobie42 wrote:
Check out foobie42's channel on youtube to know what I mean.

Oh yeah, I've checked that. Including that head tracking thingy, which is also great.

foobie42 wrote:
Also I plan to have an asynchronous art asset loader. It's much more heavy-handed now, caching all frame in all direcitons at once to avoid per-frame delay e.g. for running animations which was quite visible.

That's the way! Almost every resource should be preloaded in the background. I also load almost everything asynchronously in the OpenArcanum, using a work queue. These days such feature is necessity, as you can't just show the player black loading screen with "Loading. Please wait..." label in the middle (well you can, but it's just lame :D ).

For example, when you're about to enter the Bates mansion in Arcanum, the game should already start preloading the map when you're approaching the doors, so it can shorten the transition time between the maps. Also there should be some nice screen effect for the map transition, like fade in & out.

foobie42 wrote:
Forgot to add the palette number (2 * 3 bits) to the Tile class. So I will unify the Passability enum and palette numbers into one uint16. Fits just right.

Huh, why do you need so many bits for palette index? There can be max of 4 palettes in each .art file, right? So only 2 bits should be necessary. :thumbup:

Anyway, good luck! :)

_________________
Image
#ArcanumAlive website | #ArcanumAlive at Facebook | #OpenArcanum development | #My blog | #New wannabe modding community


Top
 Profile  
 PostPosted: Thu Mar 29, 2012 4:45 am Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
> Could you please sometimes upload to the repository a compiled
> version as well? I've noticed that you've uploaded the binaries in earlier
> revisions, but it's missing in the newer ones.

I will after I'm done with the current coding session. The first thing to do today is to fix the pixel -> tile function in WorldUtil. I even know how to do it already.

Also I noticed that reloading the map every time pixel position changes is awfully slow. :( I'll try to minimize the load somehow. IIRC tried that during last coding session, but almost fell asleep on the keyboard.

> Btw, do you have any TODO list, or some dedicated webpage, like the
> one from your previous project?

Not yet, no. Need to do some basic stuff first. There isn't even a working editor. Maybe later I'll do a roadmap.

> That's the way! Almost every resource should be preloaded in the background.

Hmm. The way I do it now, loading assets is blazingly fast anyway. When I did the coast thing, scrolling didn't result in visible delays. Also I have doubts whether showing empty space instead of a sprite is really good. Also, every access in every frame will slow down if I add locking. Perhaps I should use volatile? It's a single word anyway. Hmm...


> For example, when you're about to enter the Bates mansion in
> Arcanum, the game should already start preloading the map when
> you're approaching the doors, so it can shorten the transition time
> between the maps. Also there should be some nice screen effect for the
> map transition, like fade in & out.

Now I'm going to surprise you. There will be no transition. Everything will be one single map. I have a good scheme for doing it as you can see in the source code.

As for floors, I'll shift the player by a number of tiles upward/downward.

Don't know yet how to express it in terms of data structures, though, but we'll come to that.

> uh, why do you need so many bits for palette index? There can be max
> of 4 palettes in each .art file, right? So only 2 bits should be necessary

Yes. I was sleepy :)

> That's pretty awesome! Buy why don't you just stick with good old Lua,
> or javascript? You can bind your de/serialization routines to the scripting
> language, right?

I can't serialize closures in Lua/JS.

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Thu Mar 29, 2012 8:27 am Post subject: 
 
Water Merchant
User avatar

Joined: May 22, 2008
Posts: 585
Location: Czech Republic
foobie42 wrote:
Hmm. The way I do it now, loading assets is blazingly fast anyway. When I did the coast thing, scrolling didn't result in visible delays. Also I have doubts whether showing empty space instead of a sprite is really good. Also, every access in every frame will slow down if I add locking. Perhaps I should use volatile? It's a single word anyway. Hmm...


But you're currently loading only the terrain and tile sprites, right? When you start loading a complete map, including all entities, it will slow down the game dramatically. Also don't forget that one sector can take 5+ seconds to load. Especially, if it's full of entities, like those in Tarant. So you can't do all the asset loading in a main thread, I guess.

About the volatile qualifier, sure you may use it, but don't forget to access the variable only through atomic functions (if something like that even exists in F#).

foobie42 wrote:
I can't serialize closures in Lua/JS.

It's surely possible, look at this library: http://luaforge.net/projects/pluto/ or this one http://code.google.com/p/corsix-th/wiki/Persistance

Apparently, it's even possible to achieve without using any special library in newer versions of Lua. :)

_________________
Image
#ArcanumAlive website | #ArcanumAlive at Facebook | #OpenArcanum development | #My blog | #New wannabe modding community


Top
 Profile  
 PostPosted: Thu Mar 29, 2012 3:48 pm Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
> About the volatile qualifier, sure you may use it, but don't forget to access
> the variable only through atomic functions (if something like that even
> exists in F#).

Caching is disabled automatically for volatile fields. Also, for word-sized objects and less, every volatile access is atomic.

> Also don't forget that one sector can take 5+ seconds to load.

In my engine, every cell is 25 (was 50) tiles in size. 3 cells are loaded at a time. That makes 75x75 tiles to load at a time.

Lua closure serialization seems amazing. Thank you very much for the link! I'd spend days, no, weeks, writing a buggy and slow Scheme in F#! Thank you!

In other news, I committed a background loader. It's a big hack (see Monitor.TryEnter comment). I don't like this deadlock. But with crappy WPF there's no non-even-bigger-hack way to prevent BeginInvoke() from having to be called.

Update: the other person on the "team" says F# can serialize function bodies. We'll research in spare time.

TODO: Placing tiles/roofs/walls on the cell, saving and reloading the cell.

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Sat Mar 31, 2012 11:16 am Post subject: 
 
Water Merchant
User avatar

Joined: May 22, 2008
Posts: 585
Location: Czech Republic
foobie42 wrote:
Caching is disabled automatically for volatile fields. Also, for word-sized objects and less, every volatile access is atomic.

Are you sure? :) So why those atomic functions even exists? They all are for word-sized (and less) data types (i.e. char, short, int, long, and even a pointer). And what about the instruction reordering?

Quote:
A volatile read or write of a 32-bit int is atomic on most modern hardware...

Quote:
You might think the solution is to mark all your memory references volatile. That's just plain silly.

Quote:
Even if the compiler does not reorder the references, the hardware might.

Quote:
What you really need for ordering are memory fences, also called memory barriers. A memory fence prevents reordering of memory operations across the fence, or in some cases, prevents reordering in one direction.

Quote:
So what's the solution for multi-threaded programming? Use a library or language extension hat implements the atomic and fence semantics.


Source: http://software.intel.com/en-us/blogs/2 ... ogramming/

Edit: Whoops, I forgot that you're using F#, which does things quite differently:
Quote:
Volatile fields here are used to prevent instruction reordering and ensure CPU cache synchronization. Also as an option, instead of using volatile field, we could use here Thread.VolatileRead method (we do not need to use also Thread.VolatileWrite because actual write is done in within the lock statement which effectively prevents reordering and flushes and invalidates CPU cache, and anyway Thread.VolatileWrite only flushes the CPU cache but does not invalidate it). Basically, the static VolatileRead and VolatileWrite methods in the Thread class reads/writes a variable while enforcing (technically, a superset of) the guarantees made by the volatile keyword.


Source: http://www.codeproject.com/Articles/107 ... in-F-and-C

foobie42 wrote:
Thank you!

No problem, I'm happy to help. :D

foobie42 wrote:
Update: the other person on the "team" says F# can serialize function bodies. We'll research in spare time.

That's really interesting. :) But the reason why I've mentioned the Lua, is that it's a great and popular scripting language, and it's syntax is probably easier for beginners to learn. There is also a great chance that the players or modders would already know at least the basics of writing Lua scripts from other games.

Just saying. I know that you already know these facts. :thumbup:

Edit2: I just checked the svn repository. Thanks for the binaries! I'm going to test it as soon as I install that new .net framework, and other prerequisites.

_________________
Image
#ArcanumAlive website | #ArcanumAlive at Facebook | #OpenArcanum development | #My blog | #New wannabe modding community


Top
 Profile  
 PostPosted: Sun Apr 01, 2012 2:15 am Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
For now, volatile fields aren't used, since I found a workaround. Namely, Dispatcher.Invoke() has to be used when instantiating the WriteableBitmap() anyway so I don't need any locking.

Time to do some work on the editor. Hopefully my depression doesn't get in the way of doing stuff on the game. I already don't have any energy on paid work :(

Edit:

Added some basic support for putting tiles onto the "canvas" by left-clicking.

Next thing to do is saving and loading cells. After that, some keybindings for setting passability of tiles. Also, right click for clearing the tile of any contents.

Also my deadlock prevention suffered from some braino. It's all good now though, no more Invoke() in the cache thingy.

Further edit:

Serialization and deserialization of cells now works.

'Show grid' now works.

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Wed Apr 04, 2012 3:18 am Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
Artist bailed out :(

I'm on my own now. Don't know if I can make it.

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Sun Apr 08, 2012 7:40 pm Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
In the past few days I learned the basics of making 2D and 3D graphics.

Now I have a question - how to save a tile in BMP format as an .art file? BMP2ART spews out 'BMP file not found' and that's it.

_________________
Your kitten of death awaits!


Top
 Profile  
 PostPosted: Sun Apr 08, 2012 8:52 pm Post subject: 
 
Water Merchant
User avatar

Joined: May 22, 2008
Posts: 585
Location: Czech Republic
You can try to use the ArtGen tool for that purpose. Not sure if it'll work on tiles though.

Also, you already know the file format specification for the Art format, so you could try to write your own bmp2art converter. Shouldn't be that hard.

:)

_________________
Image
#ArcanumAlive website | #ArcanumAlive at Facebook | #OpenArcanum development | #My blog | #New wannabe modding community


Top
 Profile  
 PostPosted: Sun Apr 08, 2012 9:32 pm Post subject: 
 
Apprentice
User avatar

Joined: Sep 20, 2011
Posts: 20
Location: Poland
Yeah I'll try your ArtGen. It should work on tiles, as long as they have exactly 1 orientation.

Here are some screenshots of art I made. People I asked said it wasn't that bad, it seems pretty average.

Concrete walls and sidewalk - http://img1.uploadscreenshot.com/images ... 6-orig.jpg
Sidewalk curb - http://img1.uploadscreenshot.com/images ... 5-orig.jpg
Window and windowsill - http://img1.uploadscreenshot.com/images ... 0-orig.jpg
Bookshelf - http://img1.uploadscreenshot.com/images ... 7-orig.jpg

_________________
Your kitten of death awaits!


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ] 


Who is online

Users browsing this forum: Bing [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group