![]() |
#1 |
Prophet
Join Date: Apr 2008
Posts: 2,914
![]() |
Game cannot handle more than 255 terrain types
Reported by Tangar in this post: http://angband.oook.cz/forum/showpos...32&postcount=7
This is PWMAngband so I checked why this happened. The reason is obvious: the terrain "floor d hills" is exactly number 256 in the f_info feature array. This means there is somewhere where feature is coded on a "byte" and doesn't allow more than 255 terrain types. And I found the culprit: Code:
struct square { byte feat; bitflag *info; int light; s16b mon; struct object *obj; struct trap *trap; };
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant! |
![]() |
![]() |
![]() |
#2 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 56
Posts: 9,319
Donated: $60
![]() ![]() |
Yes, it's like that partly because (a) tradition and (b) there's nowhere near 256 different terrain types in V. But the reason for byte instead of int is that for portability of savefiles you need to only save things of a fixed length, and int is platform dependent.
So this can be fixed; the way to do it is
As you say, I suspect ints are used pretty much everywhere else, but there may be the odd other occurrence to look out for. There has been a move for about the last ten years, though, to remove the special fixed length types and replace them with ints unless there's a good reason (like savefiles) not to. So you can just to do this in PWMangband; there's no actual need to do it in V, but I probably will at some stage, if only to keep the two aligned as much as possible ![]()
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Terrain | Nick | Vanilla | 45 | November 13, 2016 21:54 |
How to handle -more- prompts? | poschengbandplayer | Vanilla | 10 | March 26, 2016 16:25 |
Terrain | Nick | Vanilla | 14 | February 22, 2014 23:07 |
Adding terrain to V | Therem Harth | Development | 14 | March 22, 2013 21:15 |
[ALL variants] Getting main-gcu to handle resizes. | CJNyfalt | Vanilla | 5 | May 27, 2007 13:47 |