News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

Real switches

Started by prissi, June 12, 2009, 10:16:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prissi

Just a demonstration, not finished: With this patch you could use real switches as in the pak 64 new stell sleeper track.

Index: besch/weg_besch.h
===================================================================
--- besch/weg_besch.h (revision 2514)
+++ besch/weg_besch.h (working copy)
@@ -169,6 +169,10 @@
return static_cast<const bildliste_besch_t *>(get_child(4))->get_bild_nr(0)!=IMG_LEER;
}

+ bool has_switch_bild() const {
+ return static_cast<const bildliste_besch_t *>(get_child(2))->get_anzahl()>16;
+ }
+
/**
* @return introduction year
* @author Hj. Malthaner
Index: besch/writer/way_writer.cc
===================================================================
--- besch/writer/way_writer.cc (revision 2514)
+++ besch/writer/way_writer.cc (working copy)
@@ -15,9 +15,11 @@
  */
void way_writer_t::write_obj(FILE* outfp, obj_node_t& parent, tabfileobj_t& obj)
{
- static const char* const ribi_codes[16] = {
+ static const char* const ribi_codes[32] = {
"-", "n",  "e",  "ne",  "s",  "ns",  "se",  "nse",
- "w", "nw", "ew", "new", "sw", "nsw", "sew", "nsew"
+ "w", "nw", "ew", "new", "sw", "nsw", "sew", "nsew",
+ "@", "@",  "@",  "@",  "@",  "@",  "@",  "nse2", // for additional directions
+ "@", "@", "@", "new2", "@", "nsw2", "sew2", "nsew2",
};
int ribi, hang;

@@ -122,7 +124,7 @@
while(number_seasons < 2) {
sprintf(buf, "image[%s][%d]", ribi_codes[0], number_seasons+1);
cstring_t str = obj.get(buf);
- if(strlen(str) > 0) {
+ if(str.len() > 0) {
number_seasons++;
} else {
break;
@@ -131,8 +133,11 @@
node.write_data_at(outfp, &number_seasons, 25, 1);
write_head(outfp, node, obj);

+ // has switch images for both directions?
+ const uint8 ribinr = *(obj.get("image[new2][0]"))==0 ? 16 : 32;
+
for (uint8 season = 0; season <= number_seasons ; season++) {
- for (ribi = 0; ribi < 16; ribi++) {
+ for (ribi = 0; ribi < ribinr; ribi++) {
char buf[40];

sprintf(buf, "image[%s][%d]", ribi_codes[ribi], season);
Index: vehicle/simvehikel.cc
===================================================================
--- vehicle/simvehikel.cc (revision 2514)
+++ vehicle/simvehikel.cc (working copy)
@@ -2653,7 +2653,7 @@
count --;
next_signal_index = i;
}
- if(!sch1->reserve(cnv->self)) {
+ if(!sch1->reserve(cnv->self,route->position_bei(min(route->get_max_n(),i+1)))) {
success = false;
}
if(next_crossing_index==65535  &&  sch1->is_crossing()) {
@@ -2765,7 +2765,7 @@
sch0->book(cargo, WAY_STAT_GOODS);
if(ist_erstes) {
sch0->book(1, WAY_STAT_CONVOIS);
- sch0->reserve(cnv->self);
+ sch0->reserve(cnv->self,pos_next);
}
}
}
@@ -3146,7 +3146,7 @@
// we unreserve also nonexisting tiles! (may happen during deletion)
if(reserve) {
start_now = true;
- if(!sch1->reserve(cnv->self)) {
+ if(!sch1->reserve(cnv->self,sch1->get_pos())) {
// unsuccessful => must unreserve all
success = false;
end = i;
Index: vehicle/simvehikel.h
===================================================================
--- vehicle/simvehikel.h (revision 2514)
+++ vehicle/simvehikel.h (working copy)
@@ -113,6 +113,7 @@
virtual image_id get_bild() const {return bild;}

sint16 get_hoff() const {return hoff;}
+ koord3d get_next_pos() const {return pos_next;}

// to make smaller steps than the tile granularity, we have to calculate our offsets ourselves!
virtual void get_screen_offset( int &xoff, int &yoff ) const;
Index: boden/wege/schiene.cc
===================================================================
--- boden/wege/schiene.cc (revision 2514)
+++ boden/wege/schiene.cc (working copy)
@@ -78,9 +78,18 @@
  * @author prissi
  */
bool
-schiene_t::reserve(convoihandle_t c) {
+schiene_t::reserve(convoihandle_t c, koord3d next) {
if(can_reserve(c)) {
reserved = c;
+ if(  ribi_t::is_threeway(ribi)  &&  besch->has_switch_bild()  ) {
+ if(  ribi_typ(get_pos(),next)&ribi_t::dir_nordwest  ) {
+ set_bild( besch->get_bild_nr( ribi+16, 0 ) );
+ }
+ else {
+ set_bild( besch->get_bild_nr( ribi, 0 ) );
+ }
+ mark_image_dirty(get_bild(),0);
+ }
if(schiene_t::show_reservations) {
mark_image_dirty(get_bild(),0);
}
Index: boden/wege/schiene.h
===================================================================
--- boden/wege/schiene.h (revision 2514)
+++ boden/wege/schiene.h (working copy)
@@ -74,7 +74,7 @@
* true, then this rail was reserved
* @author prissi
*/
- bool reserve(convoihandle_t c);
+ bool reserve(convoihandle_t c, koord3d next);

/**
* releases previous reservation
Index: boden/wege/weg.h
===================================================================
--- boden/wege/weg.h (revision 2514)
+++ boden/wege/weg.h (working copy)
@@ -67,7 +67,7 @@

enum system_type { type_flat=0, type_elevated=1, type_tram=7, type_underground=64, type_all=255 };

-private:
+protected:
/**
* array for statistical values
* MAX_WAY_STAT_MONTHS: [0] = actual value; [1] = last month value
Index: simdepot.cc
===================================================================
--- simdepot.cc (revision 2514)
+++ simdepot.cc (working copy)
@@ -487,7 +487,7 @@
return false;
}

- if(!sch0->reserve(cnv)) {
+ if(!sch0->reserve(cnv,get_pos())) {
// could not even reserve first tile ...
return false;
}
@@ -505,7 +505,7 @@
break;
}
// otherwise we might check one tile too much
- if(!sch1->reserve(cnv)) {
+ if(!sch1->reserve(cnv,route->position_bei(min(route->get_max_n(),i+1)))) {
success = false;
}
}
Index: simconvoi.cc
===================================================================
--- simconvoi.cc (revision 2514)
+++ simconvoi.cc (working copy)
@@ -355,7 +355,7 @@
// airplanes may have no ground ...
schiene_t *sch0 = dynamic_cast<schiene_t *>( gr->get_weg(fahr[i]->get_waytype()) );
if(sch0) {
- sch0->reserve(self);
+ sch0->reserve(self,v->get_next_pos());
}
}
fahr[0]->set_erstes(true);
@@ -1484,7 +1484,7 @@
// eventually reserve this
schiene_t * sch0 = dynamic_cast<schiene_t *>( welt->lookup(fahr[i]->get_pos())->get_weg(fahr[i]->get_waytype()) );
if(sch0) {
- sch0->reserve(this->self);
+ sch0->reserve(this->self,fahr[i]->get_next_pos());
}
else {
break;
@@ -1674,7 +1674,7 @@
if(v->get_waytype()==track_wt  ||  v->get_waytype()==monorail_wt  ||  v->get_waytype()==maglev_wt  ||  v->get_waytype()==narrowgauge_wt) {
schiene_t* sch = (schiene_t*)gr->get_weg(v->get_waytype());
if(sch) {
- sch->reserve(self);
+ sch->reserve(self,v->get_next_pos());
}
// add to crossing
if(gr->ist_uebergang()) {


The according dat file is here

Obj=way
Name=steel_sleeper_track2
copyright=Timothy Baldock
waytype=track
cost=40000
maintenance=1600
topspeed=450
max_weight=110
intro_year=1878
intro_month=3
cursor=way-new-steeltrack.6.0
icon=> way-new-steeltrack.6.1
# rbis * animation
Image[-][0]=way-new-steeltrack.0.0
Image[N][0]=way-new-steeltrack.1.0
Image[S][0]=way-new-steeltrack.1.1
Image[E][0]=way-new-steeltrack.1.2
Image[W][0]=way-new-steeltrack.1.3
Image[NS][0]=way-new-steeltrack.0.1
Image[EW][0]=way-new-steeltrack.0.2
Image[NSE][0]=way-new-steeltrack.0.4
Image[NSW][0]=way-new-steeltrack.1.5
Image[NEW][0]=way-new-steeltrack.1.6
Image[SEW][0]=way-new-steeltrack.0.7
Image[NSEW][0]=way-new-steeltrack.0.9
Image[NSE2][0]=way-new-steeltrack.1.4
Image[NSW2][0]=way-new-steeltrack.0.5
Image[NEW2][0]=way-new-steeltrack.0.6
Image[SEW2][0]=way-new-steeltrack.1.7
Image[NSEW2][0]=way-new-steeltrack.0.8
Image[NE][0]=way-new-steeltrack.3.0
Image[SE][0]=way-new-steeltrack.3.1
Image[NW][0]=way-new-steeltrack.3.2
Image[SW][0]=way-new-steeltrack.3.3

Diagonal[NE][0]=way-new-steeltrack.4.0
Diagonal[SE][0]=way-new-steeltrack.4.1
Diagonal[NW][0]=way-new-steeltrack.4.2
Diagonal[SW][0]=way-new-steeltrack.4.3
# hangtyp * animation
ImageUp[3][0]=way-new-steeltrack.5.0
ImageUp[6][0]=way-new-steeltrack.5.1
ImageUp[9][0]=way-new-steeltrack.5.2
ImageUp[12][0]=way-new-steeltrack.5.3
# winter
Image[-][1]=way-new-steeltrack-winter.0.2
Image[N][1]=way-new-steeltrack-winter.1.8
Image[S][1]=way-new-steeltrack-winter.1.6
Image[E][1]=way-new-steeltrack-winter.1.7
Image[W][1]=way-new-steeltrack-winter.1.9
Image[NS][1]=way-new-steeltrack-winter.0.0
Image[EW][1]=way-new-steeltrack-winter.0.1
Image[NSE][1]=way-new-steeltrack-winter.1.3
Image[NSW][1]=way-new-steeltrack-winter.1.1
Image[NEW][1]=way-new-steeltrack-winter.1.2
Image[SEW][1]=way-new-steeltrack-winter.1.4
Image[NSEW][1]=way-new-steeltrack-winter.1.0
Image[NSE2][1]=way-new-steeltrack-winter.1.3
Image[NSW2][1]=way-new-steeltrack-winter.1.1
Image[NEW2][1]=way-new-steeltrack-winter.1.2
Image[SEW2][1]=way-new-steeltrack-winter.1.4
Image[NSEW2][1]=way-new-steeltrack-winter.1.0
Image[NE][1]=way-new-steeltrack-winter.0.4
Image[SE][1]=way-new-steeltrack-winter.0.6
Image[NW][1]=way-new-steeltrack-winter.0.5
Image[SW][1]=way-new-steeltrack-winter.0.3
Diagonal[NE][1]=way-new-steeltrack-winter.2.1
Diagonal[SE][1]=way-new-steeltrack-winter.2.2
Diagonal[NW][1]=way-new-steeltrack-winter.2.3
Diagonal[SW][1]=way-new-steeltrack-winter.2.0
# hangtyp * animation
ImageUp[3][1]=way-new-steeltrack-winter.0.9
ImageUp[6][1]=way-new-steeltrack-winter.0.10
ImageUp[9][1]=way-new-steeltrack-winter.0.8
ImageUp[12][1]=way-new-steeltrack-winter.0.7


You must recompile makeobj before use.

jamespetts

This looks very interesting, but can you give more information about what real switches are in this context? Perhaps a screenshot?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Dwachs

judging from the source code, I would say, this patch changes only the appearance of junction tiles. It shows a switch in the direction when a convoi reserves its path.
Parsley, sage, rosemary, and maggikraut.

prissi

It just make nicer graphics. No other prupose than that (since I had Tomothies switches there for ages).


Index: besch/weg_besch.h
===================================================================
--- besch/weg_besch.h (revision 2516)
+++ besch/weg_besch.h (working copy)
@@ -169,6 +169,10 @@
return static_cast<const bildliste_besch_t *>(get_child(4))->get_bild_nr(0)!=IMG_LEER;
}

+ bool has_switch_bild() const {
+ return static_cast<const bildliste_besch_t *>(get_child(2))->get_anzahl()>16;
+ }
+
/**
* @return introduction year
* @author Hj. Malthaner
Index: besch/writer/way_writer.cc
===================================================================
--- besch/writer/way_writer.cc (revision 2516)
+++ besch/writer/way_writer.cc (working copy)
@@ -15,9 +15,11 @@
 */
void way_writer_t::write_obj(FILE* outfp, obj_node_t& parent, tabfileobj_t& obj)
{
- static const char* const ribi_codes[16] = {
+ static const char* const ribi_codes[32] = {
"-", "n",  "e",  "ne",  "s",  "ns",  "se",  "nse",
- "w", "nw", "ew", "new", "sw", "nsw", "sew", "nsew"
+ "w", "nw", "ew", "new", "sw", "nsw", "sew", "nsew",
+ "@", "@",  "@",  "@",  "@",  "@",  "@",  "nse2", // for additional directions
+ "@", "@", "@", "new2", "@", "nsw2", "sew2", "nsew2",
};
int ribi, hang;

@@ -122,7 +124,7 @@
while(number_seasons < 2) {
sprintf(buf, "image[%s][%d]", ribi_codes[0], number_seasons+1);
cstring_t str = obj.get(buf);
- if(strlen(str) > 0) {
+ if(str.len() > 0) {
number_seasons++;
} else {
break;
@@ -131,8 +133,11 @@
node.write_data_at(outfp, &number_seasons, 25, 1);
write_head(outfp, node, obj);

+ // has switch images for both directions?
+ const uint8 ribinr = *(obj.get("image[new2][0]"))==0 ? 16 : 32;
+
for (uint8 season = 0; season <= number_seasons ; season++) {
- for (ribi = 0; ribi < 16; ribi++) {
+ for (ribi = 0; ribi < ribinr; ribi++) {
char buf[40];

sprintf(buf, "image[%s][%d]", ribi_codes[ribi], season);
Index: vehicle/simvehikel.cc
===================================================================
--- vehicle/simvehikel.cc (revision 2516)
+++ vehicle/simvehikel.cc (working copy)
@@ -2653,7 +2653,7 @@
count --;
next_signal_index = i;
}
- if(!sch1->reserve(cnv->self)) {
+ if(  !sch1->reserve( cnv->self, ribi_typ( route->position_bei(max(1,i)-1), route->position_bei(min(route->get_max_n(),i+1)) ) )  ) {
success = false;
}
if(next_crossing_index==65535  &&  sch1->is_crossing()) {
@@ -2765,7 +2765,7 @@
sch0->book(cargo, WAY_STAT_GOODS);
if(ist_erstes) {
sch0->book(1, WAY_STAT_CONVOIS);
- sch0->reserve(cnv->self);
+ sch0->reserve( cnv->self, get_fahrtrichtung() );
}
}
}
@@ -3146,7 +3146,7 @@
// we unreserve also nonexisting tiles! (may happen during deletion)
if(reserve) {
start_now = true;
- if(!sch1->reserve(cnv->self)) {
+ if(!sch1->reserve(cnv->self,ribi_t::keine)) {
// unsuccessful => must unreserve all
success = false;
end = i;
Index: boden/wege/schiene.cc
===================================================================
--- boden/wege/schiene.cc (revision 2516)
+++ boden/wege/schiene.cc (working copy)
@@ -77,10 +77,26 @@
 * true, if this rail can be reserved
 * @author prissi
 */
-bool
-schiene_t::reserve(convoihandle_t c) {
+bool schiene_t::reserve(convoihandle_t c, ribi_t::ribi dir  )
+{
if(can_reserve(c)) {
reserved = c;
+ /* for threeway and forway switches we may need to alter graphic, if
+ * direction is a diagonal (i.e. on the switching part)
+ * and there are switching graphics
+ */
+ if(  ribi_t::is_threeway(get_ribi_unmasked())  &&  ribi_t::ist_kurve(dir)  &&  get_besch()->has_switch_bild()  ) {
+ image_id bild;
+ if(  dir==ribi_t::nordwest  ||  dir==ribi_t::suedost  ) {
+ // the second image contains the horizontal graphics
+ bild = get_besch()->get_bild_nr( get_ribi_unmasked(), is_snow() );
+ }
+ else {
+ bild = get_besch()->get_bild_nr( get_ribi_unmasked()+16, is_snow() );
+ }
+ set_bild( bild );
+ mark_image_dirty( bild, 0 );
+ }
if(schiene_t::show_reservations) {
mark_image_dirty(get_bild(),0);
}
Index: boden/wege/schiene.h
===================================================================
--- boden/wege/schiene.h (revision 2516)
+++ boden/wege/schiene.h (working copy)
@@ -74,7 +74,7 @@
* true, then this rail was reserved
* @author prissi
*/
- bool reserve(convoihandle_t c);
+ bool reserve(convoihandle_t c, ribi_t::ribi dir);

/**
* releases previous reservation
Index: boden/wege/weg.cc
===================================================================
--- boden/wege/weg.cc (revision 2516)
+++ boden/wege/weg.cc (working copy)
@@ -341,9 +341,66 @@



-void
-weg_t::calc_bild()
+// much faster recalculation of season image
+bool weg_t::check_season( const long )
{
+ // use snow image if above snowline and above ground
+ bool snow = (get_pos().z >= welt->get_snowline());
+ bool old_snow = (flags&IS_SNOW)!=0;
+ if(  !(snow ^ old_snow)  ) {
+ // season is not changing ...
+ return true;
+ }
+
+ if(  besch==NULL  ) {
+ // now way to calculate this
+ return true;
+ }
+
+ grund_t *from = welt->lookup(get_pos());
+ if(from->ist_bruecke()  &&  from->obj_bei(0)==this) {
+ // first way on a bridge (bruecke_t will set the image)
+ return true;
+ }
+
+ // set new season
+ flags &= ~IS_SNOW;
+ if(  snow  ) {
+ flags |= IS_SNOW;
+ }
+
+ hang_t::typ hang = from->get_weg_hang();
+ if(hang != hang_t::flach) {
+ set_bild( besch->get_hang_bild_nr( hang, snow ) );
+ return true;
+ }
+
+ if(  ribi_t::ist_kurve(ribi)  &&  besch->has_diagonal_bild()  ) {
+ if(  bild==besch->get_bild_nr( ribi, old_snow )  ) {
+ set_bild( besch->get_bild_nr( ribi, snow ) );
+ }
+ else {
+ set_bild( besch->get_diagonal_bild_nr( ribi, snow ) );
+ }
+ }
+ else if(  ribi_t::is_threeway(ribi)  &&  besch->has_switch_bild()  ) {
+ if(  bild==besch->get_bild_nr( ribi, old_snow )  ) {
+ set_bild( besch->get_bild_nr( ribi, snow ) );
+ }
+ else {
+ set_bild( besch->get_bild_nr( ribi+16, snow ) );
+ }
+ }
+ else {
+ set_bild( besch->get_bild_nr( ribi, snow ) );
+ }
+ return true;
+}
+
+
+
+void weg_t::calc_bild()
+{
// V.Meyer: weg_position_t changed to grund_t::get_neighbour()
grund_t *from = welt->lookup(get_pos());
grund_t *to;
@@ -360,6 +417,10 @@

// use snow image if above snowline and above ground
bool snow = (get_pos().z >= welt->get_snowline());
+ flags &= ~IS_SNOW;
+ if(  snow  ) {
+ flags |= IS_SNOW;
+ }

hang_t::typ hang = from->get_weg_hang();
if(hang != hang_t::flach) {
Index: boden/wege/weg.h
===================================================================
--- boden/wege/weg.h (revision 2516)
+++ boden/wege/weg.h (working copy)
@@ -62,7 +62,8 @@
HAS_SIGN       = 0x04,
HAS_SIGNAL     = 0x08,
HAS_WAYOBJ     = 0x10,
- HAS_CROSSING   = 0x20
+ HAS_CROSSING   = 0x20,
+ IS_SNOW = 0x80 // marker, if above snowline currently
};

enum system_type { type_flat=0, type_elevated=1, type_tram=7, type_underground=64, type_all=255 };
@@ -129,7 +130,7 @@
virtual ~weg_t();

/* seasonal image recalculation */
- bool check_season(const long /*month*/) { calc_bild(); return true; }
+ bool check_season(const long /*month*/);

/* actual image recalculation */
void calc_bild();
@@ -273,6 +274,7 @@
inline bool has_signal() const {return flags&HAS_SIGNAL; }
inline bool has_wayobj() const {return flags&HAS_WAYOBJ; }
inline bool is_crossing() const {return flags&HAS_CROSSING; }
+ inline bool is_snow() const {return flags&IS_SNOW; }

inline void set_bild( image_id b ) { bild = b; }
image_id get_bild() const {return bild;}
Index: simdepot.cc
===================================================================
--- simdepot.cc (revision 2516)
+++ simdepot.cc (working copy)
@@ -487,7 +487,7 @@
return false;
}

- if(!sch0->reserve(cnv)) {
+ if(!sch0->reserve(cnv,ribi_t::keine)) {
// could not even reserve first tile ...
return false;
}
@@ -505,7 +505,7 @@
break;
}
// otherwise we might check one tile too much
- if(!sch1->reserve(cnv)) {
+ if(  !sch1->reserve( cnv, ribi_typ( route->position_bei(max(1,i)-1), route->position_bei(min(route->get_max_n(),i+1)) ) )  ) {
success = false;
}
}
Index: simconvoi.cc
===================================================================
--- simconvoi.cc (revision 2516)
+++ simconvoi.cc (working copy)
@@ -355,7 +355,7 @@
// airplanes may have no ground ...
schiene_t *sch0 = dynamic_cast<schiene_t *>( gr->get_weg(fahr[i]->get_waytype()) );
if(sch0) {
- sch0->reserve(self);
+ sch0->reserve(self,ribi_t::keine);
}
}
fahr[0]->set_erstes(true);
@@ -1484,7 +1484,7 @@
// eventually reserve this
schiene_t * sch0 = dynamic_cast<schiene_t *>( welt->lookup(fahr[i]->get_pos())->get_weg(fahr[i]->get_waytype()) );
if(sch0) {
- sch0->reserve(this->self);
+ sch0->reserve(self,ribi_t::keine);
}
else {
break;
@@ -1674,7 +1674,7 @@
if(v->get_waytype()==track_wt  ||  v->get_waytype()==monorail_wt  ||  v->get_waytype()==maglev_wt  ||  v->get_waytype()==narrowgauge_wt) {
schiene_t* sch = (schiene_t*)gr->get_weg(v->get_waytype());
if(sch) {
- sch->reserve(self);
+ sch->reserve(self,ribi_t::keine);
}
// add to crossing
if(gr->ist_uebergang()) {


And the way:

Obj=way
Name=steel_sleeper_track2
copyright=Timothy Baldock
waytype=track
cost=40000
maintenance=1600
topspeed=450
max_weight=110
intro_year=1878
intro_month=3
cursor=way-new-steeltrack.6.0
icon=> way-new-steeltrack.6.1
# rbis * animation
Image[-][0]=way-new-steeltrack.0.0
Image[N][0]=way-new-steeltrack.1.0
Image[S][0]=way-new-steeltrack.1.1
Image[E][0]=way-new-steeltrack.1.2
Image[W][0]=way-new-steeltrack.1.3
Image[NS][0]=way-new-steeltrack.0.1
Image[EW][0]=way-new-steeltrack.0.2
Image[NSE][0]=way-new-steeltrack.0.4
Image[NSW][0]=way-new-steeltrack.0.5
Image[NEW][0]=way-new-steeltrack.0.6
Image[SEW][0]=way-new-steeltrack.0.7
Image[NSEW][0]=way-new-steeltrack.1.8
Image[NSE2][0]=way-new-steeltrack.1.4
Image[NSW2][0]=way-new-steeltrack.1.5
Image[NEW2][0]=way-new-steeltrack.1.6
Image[SEW2][0]=way-new-steeltrack.1.7
Image[NSEW2][0]=way-new-steeltrack.1.9
Image[NE][0]=way-new-steeltrack.3.0
Image[SE][0]=way-new-steeltrack.3.1
Image[NW][0]=way-new-steeltrack.3.2
Image[SW][0]=way-new-steeltrack.3.3

Diagonal[NE][0]=way-new-steeltrack.4.0
Diagonal[SE][0]=way-new-steeltrack.4.1
Diagonal[NW][0]=way-new-steeltrack.4.2
Diagonal[SW][0]=way-new-steeltrack.4.3
# hangtyp * animation
ImageUp[3][0]=way-new-steeltrack.5.0
ImageUp[6][0]=way-new-steeltrack.5.1
ImageUp[9][0]=way-new-steeltrack.5.2
ImageUp[12][0]=way-new-steeltrack.5.3
# winter
Image[-][1]=way-new-steeltrack-winter.0.2
Image[N][1]=way-new-steeltrack-winter.1.8
Image[S][1]=way-new-steeltrack-winter.1.6
Image[E][1]=way-new-steeltrack-winter.1.7
Image[W][1]=way-new-steeltrack-winter.1.9
Image[NS][1]=way-new-steeltrack-winter.0.0
Image[EW][1]=way-new-steeltrack-winter.0.1
Image[NSE][1]=way-new-steeltrack-winter.3.0
Image[NSW][1]=way-new-steeltrack-winter.3.1
Image[NEW][1]=way-new-steeltrack-winter.3.2
Image[SEW][1]=way-new-steeltrack-winter.3.3
Image[NSEW][1]=way-new-steeltrack-winter.3.4
Image[NSE2][1]=way-new-steeltrack-winter.4.0
Image[NSW2][1]=way-new-steeltrack-winter.4.1
Image[NEW2][1]=way-new-steeltrack-winter.4.2
Image[SEW2][1]=way-new-steeltrack-winter.4.3
Image[NSEW2][1]=way-new-steeltrack-winter.4.4
Image[NE][1]=way-new-steeltrack-winter.0.4
Image[SE][1]=way-new-steeltrack-winter.0.6
Image[NW][1]=way-new-steeltrack-winter.0.5
Image[SW][1]=way-new-steeltrack-winter.0.3
Diagonal[NE][1]=way-new-steeltrack-winter.2.1
Diagonal[SE][1]=way-new-steeltrack-winter.2.2
Diagonal[NW][1]=way-new-steeltrack-winter.2.3
Diagonal[SW][1]=way-new-steeltrack-winter.2.0
# hangtyp * animation
ImageUp[3][1]=way-new-steeltrack-winter.0.9
ImageUp[6][1]=way-new-steeltrack-winter.0.10
ImageUp[9][1]=way-new-steeltrack-winter.0.8
ImageUp[12][1]=way-new-steeltrack-winter.0.7


with the newest graphics from sf. Might get even into the trunk.

The result will be something like

but automatically.

jamespetts

I do like that! That does make rails greatly more realistic. I should very much like that to go into the trunk. Is there any possibility of there being a higher maintenance cost for switches than ordinary track, as in reality?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

gerw

Very nice idea! But I think, you can't distinct the to cases in the image?

Both are SEW, but you only add one new SEW graphic and two are needed for "full" switch support.

I had the following idea: each way remembers, in what directions trains are driven and show only them (maybe reset every now and then).

prissi

Exactly your idea is used by the patch. See the way dat ...

Fabio


Isaac Eiland-Hall

Ooohh! I didn't catch the significance until the followup conversation -- NOW I see what this is doing. That's awesome! :D It's so subtle, but... just... right. :D

gerw

Quote from: prissi on June 14, 2009, 09:54:28 PM
Exactly your idea is used by the patch. See the way dat ...
Not exactly, but almost ;)

And the old three-way graphics are gone, am I right? E.g. for SEW only the to images I marked above are shown?

The Hood

Nice!  Hope it makes it to trunk... (except for having to draw extra graphics that is!)

prissi

One could think also to show threewaygraphics for instance, where the way is not decided, or where trains pass both way regularily. This is no way finished, also the names on the ribis may still change.