Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old October 19, 2017, 00:33   #31
Mars
Scout
 
Mars's Avatar
 
Join Date: Apr 2007
Location: Netherlands
Posts: 29
Mars is on a distinguished road
Quote:
Originally Posted by Dean Anderson View Post
So, it's two (and a bit) years later. What's the current situation?

[snip]

And that made all the difference in the world. I now have a fully working and fully featured C# version of Cthangband 5.1.0 as well as a C version. There's no remaining un-ported code left.
Wow! Color me impressed !

IMO, things like this are quickly underestimated. Probably why these attempts usually die an early death most of the time.
__________________
Mostly retired Angband player. I just don't have the time .
Mars is offline   Reply With Quote
Old October 19, 2017, 02:10   #32
jupiter999
Rookie
 
Join Date: Nov 2012
Posts: 17
jupiter999 is on a distinguished road
I wonder if you still go for Unity or not?
I once worked on my roguelike using Unity, but shortly can't tolerate the fact that the game generated by Unity needs to spend quite some CPU resources even just idle Sorry...
jupiter999 is offline   Reply With Quote
Old October 19, 2017, 15:59   #33
Gwarl
Swordsman
 
Join Date: Jan 2017
Posts: 402
Gwarl is on a distinguished road
Quote:
Originally Posted by Dean Anderson View Post
Hmm... I'm not quite sure what you mean here.

The current architecture is that it's a Windows desktop application. The main window uses WPF to display its contents.

That's not ideal (I'm not a big fan of WPF) but - at least initially - I wanted something that would work "out of the box" rather than something that relied on third party libraries and complex install sequences.

That left me with three options:

1) Console
2) WinForms
3) WPF

I experimented with making it a pure console application, but the C# console implementation isn't all that quick, and things like wiping the screen and displaying a page full of text are noticeably slow. It's also restricted in colour usage to a pre-defined set of sixteen colours, and that set doesn't match the default Angband colours, so you have to put up with some merging and

So that left me options 2 and 3. Given that WPF takes advantage of hardware acceleration, and WinForms doesn't, I went for that. It has the advantage that you can easily change the font and window size on the fly without needing a re-start, and all the text takes advantage of ClearType font rendering so it looks nice and crisp regardless of resolution.

However, I do say that this is the current front end. I've deliberately abstracted the front end so I can switch to a different technology or library very easily.
There's a cthangband shaped hole at http://angband.live/ - I compile a lot of variants and I can't remember exactly what my guess was as to why I couldn't get cthangband working, but in most cases for Z variants it's related to a bug in Z where gcc wouldn't recognise a 64bit compiler flag and the RNG got a wrong number of bits. The fact it's in active development again motivates me to give it another try, but it needs to run in a terminal and to compile without the aid of microsoft.

Where's the download for the C version of 5.1.0?
Gwarl is offline   Reply With Quote
Old October 19, 2017, 19:06   #34
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,317
Donated: $40
Pete Mack is on a distinguished road
@Gwarl--if you're really ambitious, you can install Mono and use the C# port. But it really is ambitious: if the port is pure C#, it won't work with your Term_xxx port, so it'd need some bridge code. MS did a good job with C#. It's a better language than Java. But I don't know how much of the latest language features Mono has implemented (Tasks and LINQ are the big ones.)
Pete Mack is offline   Reply With Quote
Old October 24, 2017, 13:38   #35
Dean Anderson
Adept
 
Join Date: Nov 2009
Posts: 111
Dean Anderson is on a distinguished road
Quote:
Originally Posted by jupiter999 View Post
I wonder if you still go for Unity or not?
I once worked on my roguelike using Unity, but shortly can't tolerate the fact that the game generated by Unity needs to spend quite some CPU resources even just idle Sorry...
I really don't know, to be honest.

I might give it a go, but I want to get the code cleaner and more stable first.
Dean Anderson is offline   Reply With Quote
Old October 24, 2017, 14:04   #36
Dean Anderson
Adept
 
Join Date: Nov 2009
Posts: 111
Dean Anderson is on a distinguished road
Quote:
Originally Posted by Gwarl View Post
There's a cthangband shaped hole at http://angband.live/ - I compile a lot of variants and I can't remember exactly what my guess was as to why I couldn't get cthangband working, but in most cases for Z variants it's related to a bug in Z where gcc wouldn't recognise a 64bit compiler flag and the RNG got a wrong number of bits. The fact it's in active development again motivates me to give it another try, but it needs to run in a terminal and to compile without the aid of microsoft.

Where's the download for the C version of 5.1.0?
There isn't one, at the moment.

To be honest, it might be more effort than it's worth anyway. As part of the 5.1.0 changes, I stripped out much of the non-Windows code in preparation for the C# port.

So although there is a C version of 5.1.0 on my hard drive, it's explicitly coded for Windows; compiling inside VS2017 and incorporating a built-in front end.

To explain the front end: As part of my attempt to drag it kicking and screaming into the twenty first century, I've got rid of the whole thing where you load a character by starting the program with a command line argument and then when you die or save-and-quit the program dumps you back to the desktop. Instead, when you start the game you get to the main menu which includes multiple save slots like most modern games, and a character dying (or you doing a save-and-quit) brings you back to that menu rather than exiting the program.

It makes the game much more user-friendly, but probably means there's very little compatibility with what you're doing. Since it's been nearly 20 years (give it another six months or so) since Cthangband was forked from
Zangband, I figured that trying to maintain any sort of compatibility with other Angband versions was a fool's errand, and I may as well make wholesale changes.

That's in both the C and C# versions, and both of them automatically put your save games in the Windows user folders.

I should put the game online somewhere for people to download, though. I was thinking of waiting till I'd finished the refactoring (because some of it might break save files, which could be frustrating) but if I sort myself out a website for it I can stick it up as a beta.

Last edited by Dean Anderson; October 24, 2017 at 14:10.
Dean Anderson is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reviving Iso-Angband, an isometric view addon for Angband Hajo Development 111 August 3, 2014 20:44


All times are GMT +1. The time now is 13:10.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.