Mega Fallout: Cassandra's Path

Announce (tech) demos or games releases

Moderator: Mask of Destiny

Post Reply
Tomahomae
Interested
Posts: 15
Joined: Sat Jan 27, 2018 2:50 am
Location: Russia

Mega Fallout: Cassandra's Path

Post by Tomahomae » Sun Mar 11, 2018 4:04 am

This topic is devoted to creation of Fallout unofficial spin-off (its mechanic is identical to classic Fallout series mechanic) based upon the "Путь Кассандры" (Put' Kassandry, eng. Cassandra's Path) anti-utopia dilogy by Julia Voznesenskaya.
Maybe, it's will be succeed to add the unrealized in Star J and TLT's cancelled RPG elements to Mega Fallout project.

What's realized for now:
  • Characters screen movement (based on modified Bull's Hour engine)
  • Hexagonal cells on the background
  • Limited number of Action points and priority of each character's turn.

Todo:
  • Add the backgrounds and HUD
  • Realize the S.P.E.C.I.A.L. (from the Fallout 2) system in BEX
  • Add a NPCs, enemies and other interactive objects.

Main problems:
  • ...

Source is here. You can see the screenshots here.

SDK: BEX.
Last edited by Tomahomae on Sat Mar 17, 2018 1:56 am, edited 3 times in total.

haroldoop
Very interested
Posts: 109
Joined: Sun Apr 29, 2007 10:04 pm
Location: Belo Horizonte, MG, Brazil

Re: Mega Fallout: Cassandra's Path

Post by haroldoop » Sun Mar 11, 2018 10:36 am

That's a good start.

Tomahomae
Interested
Posts: 15
Joined: Sat Jan 27, 2018 2:50 am
Location: Russia

Re: Mega Fallout: Cassandra's Path

Post by Tomahomae » Sun Mar 11, 2018 10:39 am

haroldoop wrote:
Sun Mar 11, 2018 10:36 am
That's a good start.
Thank you. Now I'll ready to resume my project again.

Tomahomae
Interested
Posts: 15
Joined: Sat Jan 27, 2018 2:50 am
Location: Russia

Re: Mega Fallout: Cassandra's Path

Post by Tomahomae » Tue Mar 13, 2018 2:16 pm

Well, what way to compute the coordinates of nearest (by the direction character going move to) cell center can you advice?

haroldoop
Very interested
Posts: 109
Joined: Sun Apr 29, 2007 10:04 pm
Location: Belo Horizonte, MG, Brazil

Re: Mega Fallout: Cassandra's Path

Post by haroldoop » Tue Mar 13, 2018 10:37 pm

Tomahomae wrote:
Tue Mar 13, 2018 2:16 pm
Well, what way to compute the coordinates of nearest (by the direction character going move to) cell center can you advice?
You could add the width of half a cell to the x, y coordinates, and then shift right to translate that into cell coordinates.

So, supposing the cell width is 16 px:

Code: Select all


HALF_TILE = 8;

delta_x = 0;
delta_y = 0;
if (chr->dir == LEFT) {
	delta_x = -HALF_TILE;
} else if (chr->dir == RIGHT) {
	delta_x = HALF_TILE;
} else if (chr->dir == UP) {
	delta_y = -HALF_TILE;
} else if (chr->dir == DOWN) {
	delta_y = HALF_TILE;
}

x2 = chr->x + delta_x;
y2 = chr->y + delta_y;

tile_x = x2 >> 4; // Shifts right by 4 bits; effectivelly the same as x2 / 16, but faster
tile_y = y2 >> 4; // Shifts right by 4 bits; effectivelly the same as y2 / 16, but faster


Tomahomae
Interested
Posts: 15
Joined: Sat Jan 27, 2018 2:50 am
Location: Russia

Re: Mega Fallout: Cassandra's Path

Post by Tomahomae » Wed Mar 14, 2018 3:52 am

haroldoop wrote:
Tue Mar 13, 2018 10:37 pm
Tomahomae wrote:
Tue Mar 13, 2018 2:16 pm
Well, what way to compute the coordinates of nearest (by the direction character going move to) cell center can you advice?
You could add the width of half a cell to the x, y coordinates, and then shift right to translate that into cell coordinates.

So, supposing the cell width is 16 px:

Code: Select all


HALF_TILE = 8;

delta_x = 0;
delta_y = 0;
if (chr->dir == LEFT) {
	delta_x = -HALF_TILE;
} else if (chr->dir == RIGHT) {
	delta_x = HALF_TILE;
} else if (chr->dir == UP) {
	delta_y = -HALF_TILE;
} else if (chr->dir == DOWN) {
	delta_y = HALF_TILE;
}

x2 = chr->x + delta_x;
y2 = chr->y + delta_y;

tile_x = x2 >> 4; // Shifts right by 4 bits; effectivelly the same as x2 / 16, but faster
tile_y = y2 >> 4; // Shifts right by 4 bits; effectivelly the same as y2 / 16, but faster

I tried to "translate" this code from C to Basic-like language used in BEX, and to add it to my source (new code insertion is selected with a bold).

Code: Select all

 	Option TextStart, 0, 0
 	Option TextHeight, 30			' Default is 26
	Option TextWidth, 39			' Default is 38
	
	Cls

	LoadTiles topTiles1,45,256
	LoadTiles bottomTiles1,30,301
	LoadTiles topTiles2,60,331
	LoadTiles bottomTiles2,30,391
	LoadTiles CellTiles,4,421
	Palettes palette1,1,0,16
	Palettes palette2,2,0,16
	Palettes palette3,3,0,16
	Palettes cells_pal,3,0,16
	SetGfxPlane Scroll_B
	For cell_y = 0 to 28
		For cell_x= 0 to 10
			Ink 3
			DrawTiles Grid,421,(cell_x*2)+(cell_y%2)*2,cell_y,3,2
		Next
	Next
	
	character1_top = AddSprite(3,3)
	PropSprite character1_top,274,1
	MoveSprite character1_top,272,224
	character1_bottom = AddSprite(2,3)
	PropSprite character1_bottom,313,1
	MoveSprite character1_bottom,272,248
	character2_top = AddSprite(4,3)
	PropSprite character2_top,331,2
	MoveSprite character2_top,240,248
	character2_bottom = AddSprite(2,3)
	PropSprite character2_bottom,391,2
	MoveSprite character2_bottom,240,280
	Body=0
	ap=6
	characters_turn=0
	
	[b]halftile=12

	delta_x=0
	delta_y=0[/b]
	
	On VBlank GoSub main
	Enable Interrupt VBlank
	End

main:
 'Bit Hex Decimal Button
'0  &h001 1  Up
'1  &h002 2  Down
'2  &h004 4  Left
'3  &h008 8  Right
'4  &h010 16  B
'5  &h020 32  C
'6  &h040 64  A
'7  &h080 128  Start
'8  &h100 256  Z (6-Button)
'9  &h200 512  Y (6-Button)
'10  &h400 1024  X (6-Button)
'11  &h800 2048  Mode (6-Button)
'DeBug Info:
	ink 0
	locate 0,16: print "AP=";ap
	locate 1,16: print "Now turns=";characters_turn
'End DeBug Info

	c=j
	j=JoyPad(0)

	'Start
	If j.7 And c.7=0 Then
		GoSub Pause
	EndIf

 'Left
	If j.2 And j.0=0 And j.1=0 Then
		Body=2
		Gosub LookingSideChanging
		If SpritePosX(character1_top)>128 Then
			If ap>1 then
				WAITPADUP
				ap-=2
				[b]delta_x=-halftile[/b]
				if characters_turn=0 then
					[b]ShiftSprite character1_top,character_x,0
					ShiftSprite character1_bottom,character_x,0[/b]
				else
					[b]ShiftSprite character2_top,character_x,0
					ShiftSprite character2_bottom,character_x,0[/b]
				endif
				Gosub NewTurn
			else
				locate 26,1: print "Action points not enough!"
			endif
		EndIf
	EndIf
 'Right
	If j.3 And j.0=0 And j.1=0 Then
		Body=3
		Gosub LookingSideChanging
		If SpritePosX(character1_top)<424 Then
			If ap>1 then
				WAITPADUP
				ap-=2
				[b]delta_x=halftile[/b]
				if characters_turn=0 then
					[b]ShiftSprite character1_top,character_x,0
					ShiftSprite character1_bottom,character_x,0[/b]
				else
					[b]ShiftSprite character2_top,character_x,0
					ShiftSprite character2_bottom,character_x,0[/b]
				endif
				Gosub NewTurn
			else
				locate 26,1: print "Action points not enough!"
			endif
		EndIf
	EndIf
 'Up
	If j.0 And j.2=0 And j.3=0 Then
		Body=0
		Gosub LookingSideChanging
		If SpritePosY(character1_top)>128 Then
			WAITPADUP
			ap--
			[b]delta_y=-halftile[/b]
			if characters_turn=0 then
				[b]ShiftSprite character1_top,0,character_y
				ShiftSprite character1_bottom,0,character_y[/b]
			else
				[b]ShiftSprite character2_top,0,character_y
				ShiftSprite character2_bottom,0,character_y[/b]
			endif
			Gosub NewTurn
		EndIf
	EndIf
 'Down
	If j.1 And j.2=0 And j.3=0 Then
		Body=1
		Gosub LookingSideChanging
		If SpritePosY(character1_bottom)<336 Then
			WAITPADUP
			ap--
			[b]delta_y=halftile[/b]
			if characters_turn=0 then
				[b]ShiftSprite character1_top,0,character_y
				ShiftSprite character1_bottom,0,character_y[/b]
			else
				[b]ShiftSprite character2_top,0,character_y
				ShiftSprite character2_bottom,0,character_y[/b]
			endif
			Gosub NewTurn
		EndIf
	EndIf
 'Left+Up+
	If j.2 And j.0=1 And j.1=0 Then
		Body=4
		Gosub LookingSideChanging
		If SpritePosX(character1_top)>128 And SpritePosY(character1_top)>128 Then
			WAITPADUP
			ap--
			if characters_turn=0 then
				ShiftSprite character1_top,-12,-8
				ShiftSprite character1_bottom,-12,-8
			else
				ShiftSprite character2_top,-12,-8
				ShiftSprite character2_bottom,-12,-8
			endif
			Gosub NewTurn
		EndIf
	EndIf
 'Right+Up
	If j.3 And j.0 And j.1=0 Then
		Body=5
		Gosub LookingSideChanging
		If SpritePosX(character1_top)<432 And SpritePosY(character1_top)>128 Then
			WAITPADUP
			ap--
			if characters_turn=0 then
				ShiftSprite character1_top,12,-8
				ShiftSprite character1_bottom,12,-8
			else
				ShiftSprite character2_top,12,-8
				ShiftSprite character2_bottom,12,-8
			endif
			Gosub NewTurn
		EndIf
	EndIf
 'Right+Down
	If j.0=0 And j.1 And j.3 Then
		Body=7
		Gosub LookingSideChanging
		If SpritePosX(character1_top)<432 And SpritePosY(character1_bottom)<336 Then
			WAITPADUP
			ap--
			if characters_turn=0 then
				ShiftSprite character1_top,12,8
				ShiftSprite character1_bottom,12,8
			else
				ShiftSprite character2_top,12,8
				ShiftSprite character2_bottom,12,8
			endif
			Gosub NewTurn
		EndIf
	EndIf
 'Left+Down
	If j.1 And j.2 And j.3=0 Then
		Body=6
		Gosub LookingSideChanging
		If SpritePosX(character1_top)>128 And SpritePosY(character1_bottom)<336 Then
			WAITPADUP
			ap--
			if characters_turn=0 then
				ShiftSprite character1_top,-12,8
				ShiftSprite character1_bottom,-12,8
			else
				ShiftSprite character2_top,-12,8
				ShiftSprite character2_bottom,-12,8
			endif
			Gosub NewTurn
		EndIf
	EndIf
	
	[b]if characters_turn=0 then
		x2=SpritePosX(character1_bottom)+delta_x
		y2=SpritePosY(character1_bottom)+delta_y
	else
		x2=SpritePosX(character2_bottom)+delta_x
		y2=SpritePosY(character2_bottom)+delta_y
	endif
	
	character_x=x2>>4 'Shifts right by 4 bits; effectivelly the same as x2 / 16, but faster
	character_y=y2>>4 'Shifts right by 4 bits; effectivelly the same as y2 / 16, but faster[/b]
	
	Return

NewTurn:
	if ap<1 then
		ap=6
		characters_turn++
	endif
	
	if characters_turn>1 then characters_turn=0
	
	return
	
LookingSideChanging:
	if Body=0 then
		if characters_turn=0 then
			PropSprite character1_top,274,1
			PropSprite character1_bottom,313,1
		else
			PropSprite character2_top,355,2
			PropSprite character2_bottom,403,2
		endif
	endif
	if Body=1 then
		if characters_turn=0 then
			PropSprite character1_top,265,1
			PropSprite character1_bottom,307,1
		else
			PropSprite character2_top,343,2
			PropSprite character2_bottom,397,2
		endif
	endif
	if Body=2 then
		if characters_turn=0 then
			PropSprite character1_top,256,1
			PropSprite character1_bottom,301,1
		else
			PropSprite character2_top,331,2
			PropSprite character2_bottom,391,2
		endif
	endif
	if Body=3 then
		if characters_turn=0 then
			PropSprite character1_top,256+hFlipTile(1),1
			PropSprite character1_bottom,301+hFlipTile(1),1
		else
			PropSprite character2_top,331+hFlipTile(1),2
			PropSprite character2_bottom,391+hFlipTile(1),2
		endif
	endif
	if Body=4 then
		if characters_turn=0 then
			PropSprite character1_top,292,1
			PropSprite character1_bottom,325,1
		else
			PropSprite character2_top,379,2
			PropSprite character2_bottom,415,2
		endif
	endif
	if Body=5 then
		if characters_turn=0 then
			PropSprite character1_top,292+hFlipTile(1),1
			PropSprite character1_bottom,325+hFlipTile(1),1
		else
			PropSprite character2_top,379+hFlipTile(1),2
			PropSprite character2_bottom,415+hFlipTile(1),2
		endif
	endif
	if Body=6 then
		if characters_turn=0 then
			PropSprite character1_top,283,1
			PropSprite character1_bottom,319,1
		else
			PropSprite character2_top,367,2
			PropSprite character2_bottom,409,2
		endif
	endif
	if Body=7 then
		if characters_turn=0 then
			PropSprite character1_top,283+hFlipTile(1),1
			PropSprite character1_bottom,319+hFlipTile(1),1
		else
			PropSprite character2_top,367+hFlipTile(1),2
			PropSprite character2_bottom,409+hFlipTile(1),2
		endif
	endif
	
	return

But when I trying to compile new source, I taking this error every time:
Output File: basic.bin
Pass 1
Pass 2
basic.s:426: *** Error: Symbol '__INTEGER_' undefined ***
basic.s:426: *** Error: Symbol 'HALFTILE' undefined ***
basic.s:426: *** Error: Symbol '__INTEGER_' undefined ***
basic.s:426: *** Error: Symbol 'HALFTILE' undefined ***
003734 3039 00000000 move.w (__INTEGER_-halftile),d0
basic.s:673: *** Error: Symbol '__INTEGER_' undefined ***
basic.s:673: *** Error: Symbol 'HALFTILE' undefined ***
basic.s:673: *** Error: Symbol '__INTEGER_' undefined ***
basic.s:673: *** Error: Symbol 'HALFTILE' undefined ***
003AA6 3039 00000000 move.w (__INTEGER_-halftile),d0
basic.s:2898: *** Error: Illegal opcode '-' ***
017AE4 __INTEGER_-HALFTILE EQU $FF0068

00009 Total Error(s)


UnSuccessfully Compiled :( !
9 Asmx errors
Have a nice day

Press ESC to close the log window

haroldoop
Very interested
Posts: 109
Joined: Sun Apr 29, 2007 10:04 pm
Location: Belo Horizonte, MG, Brazil

Re: Mega Fallout: Cassandra's Path

Post by haroldoop » Wed Mar 14, 2018 10:50 pm

You didn't declare HALFTILE.
--- edit ---
No, you declared it, but for some reason, the Basic compiler does not see it...

Chilly Willy
Very interested
Posts: 2558
Joined: Fri Aug 17, 2007 9:33 pm

Re: Mega Fallout: Cassandra's Path

Post by Chilly Willy » Fri Mar 16, 2018 1:46 pm

Is it supposed to be __INTEGER_, __INTEGER__, or _INTEGER_? Compilers can be very picky about things like that.

Tomahomae
Interested
Posts: 15
Joined: Sat Jan 27, 2018 2:50 am
Location: Russia

Re: Mega Fallout: Cassandra's Path

Post by Tomahomae » Fri Mar 16, 2018 3:04 pm

Chilly Willy wrote:
Fri Mar 16, 2018 1:46 pm
Is it supposed to be __INTEGER_, __INTEGER__, or _INTEGER_? Compilers can be very picky about things like that.
I don't know. I don't know even if does BEX divide a variables by types.

Tomahomae
Interested
Posts: 15
Joined: Sat Jan 27, 2018 2:50 am
Location: Russia

Re: Mega Fallout: Cassandra's Path

Post by Tomahomae » Sat Mar 17, 2018 2:03 am

Meanwhile much less problematic way to realise the movement was offered to me: now it's need to hold direction and press B button to move (you can download new rom here).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest