Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old April 13, 2017, 02:40   #11
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Quote:
Originally Posted by Derakon View Post
C++ makes a modicum of sense here because you can do the upgrade piecemeal. If you're going to completely rewrite the game in a different, incompatible language, you might as well do a top-down redesign.
That's why I thought of D (and not something else). It's about as compatible as C++ is ("extern (C)"...), and less nasty.
Also, Angband is a normal procedural program and I don't see any particular reason to change that radically.

Quote:
And write it in Python.
As if Python is such a gift... I hate Python
t4nk is offline   Reply With Quote
Old April 14, 2017, 11:53   #12
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,306
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Derakon View Post
And write it in Python.
Ha. Ha. Ha. That's a noob language that nobody uses!!111one

Just to be a little constructive: I actually have a little experience in converting an existing code base from C to C++ and it does actually work out pretty smoothly[1]. Of course, there's a lot of code and it takes quite a long time to even get the basic things converted. (The pain was doubled because I first had to get rid of the Lua code by converting to plain C. "Fortunately" the Lua code was already very C-like, so it was doable. Painful but doable.)

One thing I feel very strongly about is that any large scale project must have static type checking. Maybe it's just me, but I believe very strongly in Type-driven Design... even if C++ is kind of an anemic and horrible language to do it in.

[1] I find that C++ is actually a reasonably nice language these days (post-C++14 with good-constexpr), but YMMV.

EDIT: Actually, I'd like to add: Even if nothing further comes from it, I think Pyrel was definitely a worthwhile experiment.

Last edited by AnonymousHero; April 14, 2017 at 12:04.
AnonymousHero is offline   Reply With Quote
Old April 14, 2017, 11:59   #13
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,306
AnonymousHero is on a distinguished road
@t4nk: I actually thought seriously about using D "back in the day", but honestly: At the time it was extremely niche, but even today it's (unfortunately) still quite a niche language.

Overall I do think that D might be a better language if you want to do metaprogramming (an obvious win in Angband-like code, I feel), but C++ is catching up via "static if" and constexpr...
AnonymousHero is offline   Reply With Quote
Old April 14, 2017, 16:22   #14
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 7,949
Derakon is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
EDIT: Actually, I'd like to add: Even if nothing further comes from it, I think Pyrel was definitely a worthwhile experiment.
I'm inclined to agree, and I think that it made major inroads on data-driven gameplay at a time when all spell effects, spells in spellbooks, etc. were still hardcoded in Vanilla. The container-driven "dungeon database" was also a neat concept -- you could basically query for specific categories of things in the dungeon by doing a series of set intersection operations, which made it easy to do things like "give me all of the evil monsters" or "give me all of the flammable items in this square".

In principle I believe its approach to equipment modifiers was also an interesting experiment; I'm just sad that it never reached the point where it could really be playtested.

Re: strong typing, with a project of this size, I agree, having typechecking is a must. Python does allow you to annotate variables with types and has for ages; back in 2008 I had a game project where I made a 2D coordinate tuple type that was at least an order of magnitude faster than the untyped version. But having the capability is not the same thing as mandating its use, of course.
Derakon is offline   Reply With Quote
Old April 14, 2017, 16:28   #15
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,306
AnonymousHero is on a distinguished road
Quote:
Originally Posted by Derakon View Post
...
+1, agree with, basically, everything. Btw, are you married to anyone right now?

(EDIT: That was a joke, just btw.)
AnonymousHero is offline   Reply With Quote
Old April 14, 2017, 16:52   #16
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
Just to be a little constructive: I actually have a little experience in converting an existing code base from C to C++ and it does actually work out pretty smoothly[1]
Interesting! I skimmed some files; the codebase is still very C-like (at least the parts that I saw). Well, that's not necessarily a bad thing

Quote:
I actually thought seriously about using D "back in the day", but honestly: At the time it was extremely niche, but even today it's (unfortunately) still quite a niche language.
So what, it's just Angband
Quote:
Overall I do think that D might be a better language if you want to do metaprogramming
Nah, what I want is automated garbage collection (apparently that's coming to C++... at some point), Unicode in standard library, faster compile times...

Last edited by t4nk; April 14, 2017 at 17:01.
t4nk is offline   Reply With Quote
Old April 14, 2017, 16:53   #17
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,159
Donated: $40
Pete Mack is on a distinguished road
The first one to separate spell effects was Andrew Doull (Unangband.)
Pete Mack is offline   Reply With Quote
Old April 14, 2017, 17:16   #18
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 7,949
Derakon is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
The first one to separate spell effects was Andrew Doull (Unangband.)
It's sad that we have so much duplication of effort in Angband and its variants.
Derakon is offline   Reply With Quote
Old April 14, 2017, 18:24   #19
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,306
AnonymousHero is on a distinguished road
[I]
Quote:
Originally Posted by Derakon View Post
It's sad that we have so much duplication of effort in Angband and its variants.
Such is the life of a maintainer.

EDIT: I was going to do a whole "janitor"/"maintainer" analogy here, but... meh.

Last edited by AnonymousHero; April 14, 2017 at 18:29.
AnonymousHero is offline   Reply With Quote
Old April 14, 2017, 18:52   #20
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,159
Donated: $40
Pete Mack is on a distinguished road
The improved data model for parsing makes all the difference.

If you look at the code, there's a tiny core in initialization and effect_do, and a lot of busywork (cut and paste of effects from original code, and cut and paste of projection side effects.) Using unanband would have cut busywork only slightly--you still have to verify the list of effects for V.
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
Compiling Z+Angband Ravenheart87 Variants 7 May 24, 2011 08:35
Compiling 3.2 Omnipact Development 6 December 27, 2010 09:39
compiling in VC6 NeoWizard Vanilla 1 January 16, 2009 02:10
Compiling in Linux trickypig Vanilla 6 November 16, 2008 15:26
Compiling 3.0.9b under SuSE 9.3 ... TJA Vanilla 14 May 12, 2008 21:17


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


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