Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old February 19, 2018, 22:32   #41
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,862
Donated: $40
Pete Mack is on a distinguished road
Oh gods yes. The way it was done in 3.0 was WORSE than the initial and temporary hack of turning it into a giant case statement in V3.1. It just added a second language AND extra boilerplate. Parsing text files is so much cleaner all around. So is generating code with CPP where necessary.

Quote:
Originally Posted by AnonymousHero View Post
"let's use Lua to avoid doing a parser for dice-arithmetic" (Angband)... which is pointless and awful.
Pete Mack is offline   Reply With Quote
Old February 20, 2018, 00:18   #42
droof
Apprentice
 
Join Date: Dec 2013
Posts: 71
droof is on a distinguished road
I think the C language is a barrier for new developers to try working on their ideas for a new variant. It was for me back in 2013. Maybe Lua isn't a good language either for creative feature coding, but there are plenty of alternatives. For example, Python is gaining popularity and is replacing Lua in some game engines and IoT platforms. Python is also used for education and serious work.

If we want variants that offer something unique and different from what we've seen before, then that requires coding and changes to core functionality. Text files only extend or theme what's already in place.

With text parsers maybe we can get new stories in D&D. With scripting, someone should be able to turn D&D into Pathfinder.
droof is offline   Reply With Quote
Old February 20, 2018, 01:15   #43
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,447
Derakon is on a distinguished road
Speaking as someone who tried to rewrite Angband in Python, more or less: it is a ton of work. Especially if you want to do a clean rewrite, rather than just re-implement C code in a different language.

Ultimately, it turned out that I don't care that much about Angband that I was willing to see the project through. I still feel bad for the people here that contributed to the project, only to see it die on the vine...
Derakon is offline   Reply With Quote
Old February 20, 2018, 01:26   #44
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,163
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by droof View Post
I think the C language is a barrier for new developers to try working on their ideas for a new variant. It was for me back in 2013.
Maybe so, but it's the language Angband is written in. As Derakon indicates, any project that starts off as a complete redo of many thousands of lines of code is so ambitious as to be almost certain to fall short.

A much easier route is to start by making small changes, getting more ambitious as you better understand the language and the codebase. If starting from current V, my ongoing efforts to move stuff from C code out to the text datafiles should help with that.

Note that I'm not suggesting no change for the sake of no change. It's just that I've been doing Angband coding for 12 years or so now - starting from pretty minimal knowledge of C. Feel free to ignore me though - learning from one's own mistakes is usually more effective
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old February 20, 2018, 02:32   #45
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,862
Donated: $40
Pete Mack is on a distinguished road
I don't think Python would make it a whole lot easier, except for the new object code, which was horribly plagued by stray pointer issues. A lot of complexity in Angband is language-independent.
Pete Mack is offline   Reply With Quote
Old February 20, 2018, 08:31   #46
droof
Apprentice
 
Join Date: Dec 2013
Posts: 71
droof is on a distinguished road
Quote:
Originally Posted by Nick View Post
Maybe so, but it's the language Angband is written in. As Derakon indicates, any project that starts off as a complete redo of many thousands of lines of code is so ambitious as to be almost certain to fall short.

A much easier route is to start by making small changes, getting more ambitious as you better understand the language and the codebase. If starting from current V, my ongoing efforts to move stuff from C code out to the text datafiles should help with that.

Note that I'm not suggesting no change for the sake of no change. It's just that I've been doing Angband coding for 12 years or so now - starting from pretty minimal knowledge of C. Feel free to ignore me though - learning from one's own mistakes is usually more effective
I don't suggest a rewrite. Refactoring in small steps is the right way to go.

And I agree that C can be learned. Troubles with C for me are mostly pointers, pointer to data type conversions and 32-bit / 64-bit compatible code. In other languages I never had to think about these situations.

It is difficult and I have to figure out a lot of stuff myself. This work requires dedicated developers and plenty of developers who would code games won't endure that much. I know plenty of developers who are not this ambitious.

Quote:
Originally Posted by Pete Mack View Post
I don't think Python would make it a whole lot easier, except for the new object code, which was horribly plagued by stray pointer issues. A lot of complexity in Angband is language-independent.
That's something you know best and I can only guess at. Most of the complexity is from Angband itself, but how much complexity is from pointers and limited data types?
droof is offline   Reply With Quote
Old February 20, 2018, 12:50   #47
droof
Apprentice
 
Join Date: Dec 2013
Posts: 71
droof is on a distinguished road
So in summary, T-Engine is a Lua API for rogue-like modules.

Angband is moving to rogue-like modules by text file configuration. Configuration over scripting.
droof is offline   Reply With Quote
Old February 20, 2018, 12:57   #48
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,850
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by droof View Post
And I agree that C can be learned. Troubles with C for me are mostly pointers, pointer to data type conversions and 32-bit / 64-bit compatible code. In other languages I never had to think about these situations.
It's true, when you are dealing with the nuts and bolts, it is harder. It makes you a much better coder though!

Quote:
That's something you know best and I can only guess at. Most of the complexity is from Angband itself, but how much complexity is from pointers and limited data types?
There's some (a lot of) boilerplate because you're in C but I wouldn't call that complexity. String handling is a pain but it works fine. I'd say most complexity in Angband is down to the sheer weight of previous decisions in a game that's had stuff added to it for ~30 years in a haphazard way and was originally translated from a different programming language. (Moria started off life in VMS Pascal.)

Obviously if you were writing a new game, you wouldn't start from here: you'd make different design decisions, you'd have less 'flavour' to retain, and yes, you'd choose a different language. I'd probably write it in Rust if I was going to start from scratch now.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old February 20, 2018, 19:10   #49
droof
Apprentice
 
Join Date: Dec 2013
Posts: 71
droof is on a distinguished road
Okay then, maybe this will make coding in C a little easier. Forget embedded languages and scripting languages. How about Cello from libcello.org?

It's native C. Usage is drop-in and optional. No embedding or rewriting anything. No additional language. It enables higher level programming in C with dynamic types, eliminates direct usage of pointers, functions accept and return dynamic types and it offers easy object list manipulation. In other words, it allows me to treat C like Python without Python, or like javascript with underscorejs.

Cello is non-standard and would have to be compiled alongside the code. Unless it's included in the codebase and make file, compiling would be more difficult because of this library.
droof is offline   Reply With Quote
Old February 20, 2018, 22:31   #50
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,862
Donated: $40
Pete Mack is on a distinguished road
Yes. Configuration wherever possible.
There are two places where C really gets in the way: the Object code as I mentioned before, and the event listening code, which is really quite ugly.

Quote:
Originally Posted by droof View Post
So in summary, T-Engine is a Lua API for rogue-like modules.

Angband is moving to rogue-like modules by text file configuration. Configuration over scripting.
Pete Mack 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
Angband 3.5-dev Magnate Vanilla 70 July 2, 2012 16:47
Escape key bug in Angband dev version 21 Dec 2011 revision 700d8c8 Shockbolt Development 2 January 7, 2012 10:12
Looks like a new Angband Dev Blog is up. (17.8.2011) CJNyfalt Vanilla 23 August 20, 2011 16:46
angband-dev@oook.cz down? d_m Development 2 August 4, 2010 16:47
New to Angband Dev shinobibear Development 10 June 10, 2010 18:11


All times are GMT +1. The time now is 07:11.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.